From c56e2818720986efca260709671b7ecfdd990c06 Mon Sep 17 00:00:00 2001 From: Siwoo Jeon Date: Sun, 11 May 2025 13:57:36 +0900 Subject: [PATCH] chore: edit discommand struct --- commands/deleteLearnedData.go | 2 +- commands/discommand.go | 4 ++-- commands/help.go | 2 +- commands/learn.go | 2 +- commands/learnedDataList.go | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/commands/deleteLearnedData.go b/commands/deleteLearnedData.go index aaa31e0..13eaeb4 100644 --- a/commands/deleteLearnedData.go +++ b/commands/deleteLearnedData.go @@ -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) diff --git a/commands/discommand.go b/commands/discommand.go index 3221306..6d627d2 100644 --- a/commands/discommand.go +++ b/commands/discommand.go @@ -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}) } } diff --git a/commands/help.go b/commands/help.go index 307a839..7de4052 100644 --- a/commands/help.go +++ b/commands/help.go @@ -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) diff --git a/commands/learn.go b/commands/learn.go index be0fe30..d3bf3bc 100644 --- a/commands/learn.go +++ b/commands/learn.go @@ -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) diff --git a/commands/learnedDataList.go b/commands/learnedDataList.go index dc7b486..ccd9333 100644 --- a/commands/learnedDataList.go +++ b/commands/learnedDataList.go @@ -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)