1
0
Fork 0
mirror of https://github.com/diamondburned/arikawa.git synced 2025-01-08 21:17:51 +00:00

bot: remove deprecated Subcommand.SanitizeMessage

This commit is contained in:
Maximilian von Lindern 2021-06-06 15:12:16 +02:00 committed by diamondburned
parent f1f4f06979
commit 2875635532

View file

@ -76,12 +76,6 @@ type Subcommand struct {
// Aliases is alternative way to call this subcommand in Discord.
Aliases []string
// SanitizeMessage is currently no longer used automatically.
// AllowedMentions is used instead.
//
// This field is deprecated and will be removed eventually.
SanitizeMessage func(content string) string
// Commands can return either a string, a *discord.Embed, or an
// *api.SendMessageData, with error as the second argument.
@ -124,12 +118,7 @@ type CanHelp interface {
// NewSubcommand is used to make a new subcommand. You usually wouldn't call
// this function, but instead use (*Context).RegisterSubcommand().
func NewSubcommand(cmd interface{}) (*Subcommand, error) {
var sub = Subcommand{
command: cmd,
SanitizeMessage: func(c string) string {
return c
},
}
sub := Subcommand{command: cmd}
if err := sub.reflectCommands(); err != nil {
return nil, errors.Wrap(err, "failed to reflect commands")