From 3469d1a0b3e6b9ad57edbef7916aebac91a31eaa Mon Sep 17 00:00:00 2001 From: Etzelia Date: Fri, 9 Jul 2021 15:19:17 -0500 Subject: [PATCH] Move welcome channel to register table Signed-off-by: Etzelia --- config/canopeas.example.toml | 6 +++--- config/config.go | 14 +++++++------- discord/register.go | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/config/canopeas.example.toml b/config/canopeas.example.toml index 471a13a..f1ff6a1 100644 --- a/config/canopeas.example.toml +++ b/config/canopeas.example.toml @@ -25,9 +25,6 @@ meme_rate = "0" # Imgur Client ID imgur_client_id = "" -# welcome_channel is the channel to message to welcome the newly registered user -welcome_channel = "0" - [register] # role is the role to assign to a user after registering role = "0" @@ -35,6 +32,9 @@ role = "0" # url is the URL to show to new users url = "https://google.com" +# welcome_channel is the channel to message to welcome the newly registered user +welcome_channel = "0" + # ServerAPI options [serverapi] # API endpoint diff --git a/config/config.go b/config/config.go index a37a0a4..bd0d679 100644 --- a/config/config.go +++ b/config/config.go @@ -40,14 +40,14 @@ type Config struct { Albums []Album `toml:"albums"` MessageRoles []MessageRole `toml:"message_roles"` Register struct { - URL string `toml:"url"` - Role string `toml:"role"` + URL string `toml:"url"` + Role string `toml:"role"` + WelcomeChannel string `toml:"welcome_channel"` } `toml:"register"` - WelcomeChannel string `toml:"welcome_channel"` - LeaveChannel string `toml:"leave_channel"` - FiredRole string `toml:"fired_role"` - MemeRate string `toml:"meme_rate"` - Insult struct { + LeaveChannel string `toml:"leave_channel"` + FiredRole string `toml:"fired_role"` + MemeRate string `toml:"meme_rate"` + Insult struct { Targets []string `toml:"targets"` Comparisons []string `toml:"comparisons"` Adjectives []string `toml:"adjectives"` diff --git a/discord/register.go b/discord/register.go index 3930057..3e4820a 100644 --- a/discord/register.go +++ b/discord/register.go @@ -105,7 +105,7 @@ func init() { } // Don't return feedback because this goes in a different channel - sendMessage(cmd.session, cmd.config.WelcomeChannel, fmt.Sprintf("Welcome, **%s**!", cmd.message.Author.Mention()), false) + sendMessage(cmd.session, cmd.config.Register.WelcomeChannel, fmt.Sprintf("Welcome, **%s**!", cmd.message.Author.Mention()), false) return "", nil }, help: "Register yourself with the Discord",