chore: edit discommand struct
This commit is contained in:
parent
5f881b4ec5
commit
c56e281872
5 changed files with 6 additions and 6 deletions
|
@ -31,7 +31,7 @@ var DeleteLearnedDataCommand *Command = &Command{
|
|||
},
|
||||
Category: Chatting,
|
||||
MessageRun: func(ctx *MsgContext) {
|
||||
deleteLearnedDataRun(ctx.Command, ctx.Session, ctx.Msg, &ctx.Args)
|
||||
deleteLearnedDataRun(ctx.Command, ctx.Session, ctx.Msg, ctx.Args)
|
||||
},
|
||||
ChatInputRun: func(ctx *ChatInputContext) {
|
||||
deleteLearnedDataRun(ctx.Command, ctx.Session, ctx.Inter, nil)
|
||||
|
|
|
@ -37,7 +37,7 @@ type DiscommandStruct struct {
|
|||
type MsgContext struct {
|
||||
Session *discordgo.Session
|
||||
Msg *discordgo.MessageCreate
|
||||
Args []string
|
||||
Args *[]string
|
||||
Command *Command
|
||||
}
|
||||
|
||||
|
@ -94,7 +94,7 @@ func (d *DiscommandStruct) LoadComponent(c *Component) {
|
|||
|
||||
func (d *DiscommandStruct) MessageRun(name string, s *discordgo.Session, m *discordgo.MessageCreate, args []string) {
|
||||
if command, ok := d.Commands[name]; ok {
|
||||
command.MessageRun(&MsgContext{s, m, args, command})
|
||||
command.MessageRun(&MsgContext{s, m, &args, command})
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ var HelpCommand *Command = &Command{
|
|||
},
|
||||
Category: General,
|
||||
MessageRun: func(ctx *MsgContext) {
|
||||
helpRun(ctx.Session, ctx.Msg, &ctx.Args)
|
||||
helpRun(ctx.Session, ctx.Msg, ctx.Args)
|
||||
},
|
||||
ChatInputRun: func(ctx *ChatInputContext) {
|
||||
helpRun(ctx.Session, ctx.Inter, nil)
|
||||
|
|
|
@ -57,7 +57,7 @@ var LearnCommand *Command = &Command{
|
|||
},
|
||||
Category: Chatting,
|
||||
MessageRun: func(ctx *MsgContext) {
|
||||
learnRun(ctx.Command, ctx.Session, ctx.Msg, &ctx.Args)
|
||||
learnRun(ctx.Command, ctx.Session, ctx.Msg, ctx.Args)
|
||||
},
|
||||
ChatInputRun: func(ctx *ChatInputContext) {
|
||||
learnRun(ctx.Command, ctx.Session, ctx.Inter, nil)
|
||||
|
|
|
@ -42,7 +42,7 @@ var LearnedDataListCommand *Command = &Command{
|
|||
},
|
||||
Category: Chatting,
|
||||
MessageRun: func(ctx *MsgContext) {
|
||||
learnedDataListRun(ctx.Session, ctx.Msg, &ctx.Args)
|
||||
learnedDataListRun(ctx.Session, ctx.Msg, ctx.Args)
|
||||
},
|
||||
ChatInputRun: func(ctx *ChatInputContext) {
|
||||
learnedDataListRun(ctx.Session, ctx.Inter, nil)
|
||||
|
|
Loading…
Reference in a new issue