From 21bd2a2c8bbb4def7009694f736662b92b04e02b Mon Sep 17 00:00:00 2001 From: Etzelia Date: Thu, 13 May 2021 22:07:58 -0500 Subject: [PATCH] Rename echo/album field to child Signed-off-by: Etzelia --- discord/clear.go | 2 +- discord/discord.go | 3 +-- discord/echo.go | 2 +- discord/help.go | 2 +- discord/imgur.go | 2 +- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/discord/clear.go b/discord/clear.go index 56ca952..3a86822 100644 --- a/discord/clear.go +++ b/discord/clear.go @@ -9,7 +9,7 @@ const clearMax = 20 func init() { commands = append(commands, &command{ - name: "clear", + name: "clear", staffOnly: true, validate: func(cmd commandInit) bool { return isStaff(cmd.message.Member.Roles, cmd.config.StaffRoles) diff --git a/discord/discord.go b/discord/discord.go index ac73f80..93c5f89 100644 --- a/discord/discord.go +++ b/discord/discord.go @@ -37,8 +37,7 @@ type commandInit struct { type command struct { staffOnly bool deleteInvocation bool - echo bool - album bool + child bool // TODO Does this really need to exist separately? validate func(cmd commandInit) bool run func(cmd commandInit) (string, error) diff --git a/discord/echo.go b/discord/echo.go index b69bd85..7c230d5 100644 --- a/discord/echo.go +++ b/discord/echo.go @@ -14,7 +14,7 @@ func Echo(cfg *config.Config) { commands = append(commands, &command{ name: e.Name, aliases: e.Aliases, - echo: true, + child: true, validate: func(cmd commandInit) bool { return true }, diff --git a/discord/help.go b/discord/help.go index a8fcd53..9b88c32 100644 --- a/discord/help.go +++ b/discord/help.go @@ -65,7 +65,7 @@ func allHelp(cmd commandInit) *discordgo.MessageEmbed { embed.Description = "Commands with an asterisk (*) are staff-only" } for _, c := range commands { - if c.echo || c.album { + if c.child { continue } diff --git a/discord/imgur.go b/discord/imgur.go index 8449f52..8c441f5 100644 --- a/discord/imgur.go +++ b/discord/imgur.go @@ -19,7 +19,7 @@ func Album(cfg *config.Config) error { commands = append(commands, &command{ name: a.Name, aliases: a.Aliases, - album: true, + child: true, validate: func(cmd commandInit) bool { return true },