chore: edit discommand struct

This commit is contained in:
Siwoo Jeon 2025-05-11 13:57:36 +09:00
parent 5f881b4ec5
commit c56e281872
Signed by: migan
GPG key ID: 036E9A8C5E8E48DA
5 changed files with 6 additions and 6 deletions

View file

@ -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)

View file

@ -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})
}
}

View file

@ -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)

View file

@ -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)

View file

@ -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)