diff --git a/commands/chat.go b/commands/chat.go index bced5d8..ec6a85e 100644 --- a/commands/chat.go +++ b/commands/chat.go @@ -28,6 +28,7 @@ var ChatCommand *Command = &Command{ Category: Chatting, RegisterApplicationCommand: true, RegisterMessageCommand: false, + Flags: CommandFlagsIsRegistered, ChatInputRun: func(ctx *ChatInputContext) { i := ctx.Inter i.DeferReply(&discordgo.InteractionResponseData{}) diff --git a/commands/dataLength.go b/commands/dataLength.go index 4489cbb..a380c5b 100644 --- a/commands/dataLength.go +++ b/commands/dataLength.go @@ -44,6 +44,7 @@ var DataLengthCommand *Command = &Command{ Category: General, RegisterApplicationCommand: true, RegisterMessageCommand: true, + Flags: CommandFlagsIsRegistered, MessageRun: func(ctx *MsgContext) { dataLengthRun(ctx.Msg.Session, ctx.Msg, ctx.Msg.Author.Username, ctx.Msg.Author.ID) }, diff --git a/commands/deleteLearnedData.go b/commands/deleteLearnedData.go index 6a2fda1..7cb037d 100644 --- a/commands/deleteLearnedData.go +++ b/commands/deleteLearnedData.go @@ -32,6 +32,7 @@ var DeleteLearnedDataCommand *Command = &Command{ Category: Chatting, RegisterApplicationCommand: true, RegisterMessageCommand: true, + Flags: CommandFlagsIsRegistered, MessageRun: func(ctx *MsgContext) { command := strings.Join(*ctx.Args, " ") if command == "" { diff --git a/commands/learn.go b/commands/learn.go index 588e1e6..4c2be1c 100644 --- a/commands/learn.go +++ b/commands/learn.go @@ -59,6 +59,7 @@ var LearnCommand *Command = &Command{ Category: Chatting, RegisterApplicationCommand: true, RegisterMessageCommand: true, + Flags: CommandFlagsIsRegistered, MessageRun: func(ctx *MsgContext) { if len(*ctx.Args) < 2 { utils.NewMessageSender(ctx.Msg). diff --git a/commands/learnedDataList.go b/commands/learnedDataList.go index 005b9d5..f42f753 100644 --- a/commands/learnedDataList.go +++ b/commands/learnedDataList.go @@ -53,6 +53,7 @@ var LearnedDataListCommand *Command = &Command{ Category: Chatting, RegisterApplicationCommand: true, RegisterMessageCommand: true, + Flags: CommandFlagsIsRegistered, MessageRun: func(ctx *MsgContext) { var length int diff --git a/configs/version.go b/configs/version.go index 6e4b0e8..6e645f4 100644 --- a/configs/version.go +++ b/configs/version.go @@ -7,7 +7,7 @@ import ( "git.wh64.net/muffin/goMuffin/utils" ) -const MUFFIN_VERSION = "0.0.0-madeleine_canary.250620a" +const MUFFIN_VERSION = "0.0.0-madeleine_canary.250621a" var updatedString string = utils.RegexpDecimals.FindAllStringSubmatch(MUFFIN_VERSION, -1)[3][0] diff --git a/handler/messageCreate.go b/handler/messageCreate.go index 73257fe..926ba35 100644 --- a/handler/messageCreate.go +++ b/handler/messageCreate.go @@ -38,6 +38,17 @@ func MessageCreate(s *discordgo.Session, m *discordgo.MessageCreate) { command := commands.Discommand.Aliases[args[0]] if command == "" || command == "대화" { + if !databases.Database.IsUser(m.Author.ID) { + utils.NewMessageSender(&utils.MessageCreate{ + MessageCreate: m, + Session: s, + }). + AddComponents(utils.GetUserIsNotRegisteredErrContainer(configs.Config.Bot.Prefix)). + SetComponentsV2(true). + SetReply(true). + Send() + return + } s.ChannelTyping(m.ChannelID) str, err := chatbot.ChatBot.GetResponse(m.Author, strings.TrimPrefix(content, "대화 "))