From df3af0ccc65262b7edd0734238e3d36193710b62 Mon Sep 17 00:00:00 2001 From: Dustin Pianalto Date: Tue, 7 Apr 2020 20:50:09 -0800 Subject: [PATCH] Add command to get logging channel --- djpianalto.com/goff/exts/guild.go | 2 +- djpianalto.com/goff/exts/init.go | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/djpianalto.com/goff/exts/guild.go b/djpianalto.com/goff/exts/guild.go index c3d3ecc..68298de 100644 --- a/djpianalto.com/goff/exts/guild.go +++ b/djpianalto.com/goff/exts/guild.go @@ -49,7 +49,7 @@ func loggingChannel(ctx disgoman.Context, args []string) error { return nil } -func getLoggingCommand(ctx disgoman.Context, _ []string) error { +func getLoggingChannel(ctx disgoman.Context, _ []string) error { var channelID string row := utils.Database.QueryRow("SELECT logging_channel FROM guilds where id=$1", ctx.Guild.ID) err := row.Scan(channelID) diff --git a/djpianalto.com/goff/exts/init.go b/djpianalto.com/goff/exts/init.go index 9a2c231..f7784dd 100644 --- a/djpianalto.com/goff/exts/init.go +++ b/djpianalto.com/goff/exts/init.go @@ -94,4 +94,13 @@ func AddCommandHandlers(h *disgoman.CommandManager) { RequiredPermissions: disgoman.PermissionManageServer, Invoke: loggingChannel, }) + h.AddCommand(&disgoman.Command{ + Name: "get-logging-channel", + Aliases: []string{"glc"}, + Description: "Gets the channel logging messages will be sent to.", + OwnerOnly: false, + Hidden: false, + RequiredPermissions: disgoman.PermissionManageServer, + Invoke: getLoggingChannel, + }) }