diff --git a/cmd/welcomebot/listener/listener.go b/cmd/welcomebot/event/listener.go similarity index 95% rename from cmd/welcomebot/listener/listener.go rename to cmd/welcomebot/event/listener.go index 9111273..f062a1e 100644 --- a/cmd/welcomebot/listener/listener.go +++ b/cmd/welcomebot/event/listener.go @@ -1,4 +1,4 @@ -package listener +package event import ( "fmt" @@ -8,7 +8,7 @@ import ( "time" ) -func JoinListener(event *events.GuildMemberJoin) { +func JoinEvent(event *events.GuildMemberJoin) { // on join send message in welcome user := event.Member.User if event.GuildID.String() != config.RegisterGuildID.String() { @@ -43,7 +43,7 @@ func JoinListener(event *events.GuildMemberJoin) { } } -func LeaveListener(event *events.GuildMemberLeave) { +func LeaveEvent(event *events.GuildMemberLeave) { user := event.User if event.GuildID.String() != config.RegisterGuildID.String() { @@ -68,7 +68,7 @@ func LeaveListener(event *events.GuildMemberLeave) { } } -func ReactionListener(event *events.ComponentInteractionCreate) { +func ReactionEvent(event *events.ComponentInteractionCreate) { if event.ChannelID() != config.ChannelWelcomeID { // reaction is not in welcome chat diff --git a/cmd/welcomebot/main.go b/cmd/welcomebot/main.go index 3639b32..c9eba5e 100644 --- a/cmd/welcomebot/main.go +++ b/cmd/welcomebot/main.go @@ -8,7 +8,7 @@ import ( "github.com/disgoorg/disgo/gateway" "github.com/disgoorg/log" "grow.rievo.dev/discordBots/cmd/welcomebot/config" - "grow.rievo.dev/discordBots/cmd/welcomebot/listener" + "grow.rievo.dev/discordBots/cmd/welcomebot/event" "os" "os/signal" "syscall" @@ -30,9 +30,9 @@ func main() { cache.FlagsNone, ), ), - bot.WithEventListenerFunc(listener.JoinListener), - bot.WithEventListenerFunc(listener.LeaveListener), - bot.WithEventListenerFunc(listener.ReactionListener), + bot.WithEventListenerFunc(event.JoinEvent), + bot.WithEventListenerFunc(event.LeaveEvent), + bot.WithEventListenerFunc(event.ReactionEvent), ) if err != nil { log.Fatal("error while building disgo instance: ", err)