mirror of
https://github.com/diamondburned/arikawa.git
synced 2025-01-09 13:37:02 +00:00
bot: remove deprecated Subcommand.SanitizeMessage
This commit is contained in:
parent
f1f4f06979
commit
2875635532
|
@ -76,12 +76,6 @@ type Subcommand struct {
|
||||||
// Aliases is alternative way to call this subcommand in Discord.
|
// Aliases is alternative way to call this subcommand in Discord.
|
||||||
Aliases []string
|
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
|
// Commands can return either a string, a *discord.Embed, or an
|
||||||
// *api.SendMessageData, with error as the second argument.
|
// *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
|
// NewSubcommand is used to make a new subcommand. You usually wouldn't call
|
||||||
// this function, but instead use (*Context).RegisterSubcommand().
|
// this function, but instead use (*Context).RegisterSubcommand().
|
||||||
func NewSubcommand(cmd interface{}) (*Subcommand, error) {
|
func NewSubcommand(cmd interface{}) (*Subcommand, error) {
|
||||||
var sub = Subcommand{
|
sub := Subcommand{command: cmd}
|
||||||
command: cmd,
|
|
||||||
SanitizeMessage: func(c string) string {
|
|
||||||
return c
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := sub.reflectCommands(); err != nil {
|
if err := sub.reflectCommands(); err != nil {
|
||||||
return nil, errors.Wrap(err, "failed to reflect commands")
|
return nil, errors.Wrap(err, "failed to reflect commands")
|
||||||
|
|
Loading…
Reference in a new issue