Merge branch 'hotfix/train' into feature/muffinAI
This commit is contained in:
commit
7b64c3eea0
3 changed files with 18 additions and 11 deletions
|
@ -140,6 +140,14 @@ func learnRun(m any, userId, command, result string) {
|
|||
}
|
||||
}
|
||||
|
||||
if len([]rune(command)) > 100 {
|
||||
utils.NewMessageSender(m).
|
||||
AddComponents(utils.GetErrorContainer(discordgo.TextDisplay{Content: "단어는 100글자를 못 넘ㅇ어가요."})).
|
||||
SetComponentsV2(true).
|
||||
SetReply(true).
|
||||
Send()
|
||||
}
|
||||
|
||||
_, err := databases.Database.Learns.InsertOne(context.TODO(), databases.InsertLearn{
|
||||
Command: command,
|
||||
Result: result,
|
||||
|
|
|
@ -7,7 +7,7 @@ import (
|
|||
"git.wh64.net/muffin/goMuffin/utils"
|
||||
)
|
||||
|
||||
const MUFFIN_VERSION = "0.0.0-madeleine_canary.250525a-muffin-ai"
|
||||
const MUFFIN_VERSION = "0.0.0-madeleine_canary.250526a-muffin-ai"
|
||||
|
||||
var updatedString string = utils.RegexpDecimals.FindAllStringSubmatch(MUFFIN_VERSION, -1)[3][0]
|
||||
|
||||
|
|
|
@ -57,16 +57,6 @@ func MessageCreate(s *discordgo.Session, m *discordgo.MessageCreate) {
|
|||
args := argParser(content)
|
||||
command := commands.Discommand.Aliases[args[0]]
|
||||
|
||||
if m.Author.ID == config.Train.UserID {
|
||||
if _, err := databases.Database.Texts.InsertOne(context.TODO(), databases.InsertText{
|
||||
Text: content,
|
||||
Persona: "muffin",
|
||||
CreatedAt: time.Now(),
|
||||
}); err != nil {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
}
|
||||
|
||||
if command == "" {
|
||||
s.ChannelTyping(m.ChannelID)
|
||||
|
||||
|
@ -82,6 +72,15 @@ func MessageCreate(s *discordgo.Session, m *discordgo.MessageCreate) {
|
|||
commands.Discommand.MessageRun(command, s, m, args[1:])
|
||||
return
|
||||
} else {
|
||||
if m.Author.ID == config.Train.UserID {
|
||||
if _, err := databases.Database.Texts.InsertOne(context.TODO(), databases.InsertText{
|
||||
Text: m.Content,
|
||||
Persona: "muffin",
|
||||
CreatedAt: time.Now(),
|
||||
}); err != nil {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue