Compentize Workload (#4)

This commit is contained in:
2023-03-30 23:51:05 -04:00
committed by GitHub
parent 228c293b70
commit 3d15d09dd7
21 changed files with 528 additions and 319 deletions

View File

@ -8,7 +8,7 @@ import (
"github.com/bwmarrin/discordgo"
"github.com/stretchr/testify/mock"
"github.com/yeslayla/birdbot/core"
"github.com/yeslayla/birdbot/common"
)
type Discord struct {
@ -64,7 +64,7 @@ func (discord *Discord) OnReady(handler func(*Discord)) {
}
// OnEventCreate registers a handler when a guild scheduled event is created
func (discord *Discord) OnEventCreate(handler func(*Discord, *core.Event)) {
func (discord *Discord) OnEventCreate(handler func(*Discord, common.Event)) {
discord.session.AddHandler(func(s *discordgo.Session, r *discordgo.GuildScheduledEventCreate) {
if r.GuildID != discord.guildID {
return
@ -75,7 +75,7 @@ func (discord *Discord) OnEventCreate(handler func(*Discord, *core.Event)) {
}
// OnEventDelete registers a handler when a guild scheduled event is deleted
func (discord *Discord) OnEventDelete(handler func(*Discord, *core.Event)) {
func (discord *Discord) OnEventDelete(handler func(*Discord, common.Event)) {
discord.session.AddHandler(func(s *discordgo.Session, r *discordgo.GuildScheduledEventDelete) {
if r.GuildID != discord.guildID {
return
@ -86,7 +86,7 @@ func (discord *Discord) OnEventDelete(handler func(*Discord, *core.Event)) {
}
// OnEventUpdate registers a handler when a guild scheduled event is updated
func (discord *Discord) OnEventUpdate(handler func(*Discord, *core.Event)) {
func (discord *Discord) OnEventUpdate(handler func(*Discord, common.Event)) {
discord.session.AddHandler(func(s *discordgo.Session, r *discordgo.GuildScheduledEventUpdate) {
if r.GuildID != discord.guildID {
return