Compare commits
8 commits
Author | SHA1 | Date | |
---|---|---|---|
ea0dd64df8 | |||
a76d0344c9 | |||
b074e49909 | |||
e5090fa35d | |||
dc57303dfa | |||
b573016d0e | |||
fce4dc2e73 | |||
eb7a41e669 |
4 changed files with 29 additions and 11 deletions
|
@ -173,6 +173,23 @@ func learnRun(c *Command, s *discordgo.Session, m any, args *[]string) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len([]rune(command)) > 100 {
|
||||||
|
embed := &discordgo.MessageEmbed{
|
||||||
|
Title: "❌ 오류",
|
||||||
|
Description: "단어는 100글자를 못 넘ㅇ어가요.",
|
||||||
|
Color: utils.EmbedFail,
|
||||||
|
}
|
||||||
|
|
||||||
|
switch m := m.(type) {
|
||||||
|
case *discordgo.MessageCreate:
|
||||||
|
s.ChannelMessageSendEmbedReply(m.ChannelID, embed, m.Reference())
|
||||||
|
case *utils.InteractionCreate:
|
||||||
|
m.EditReply(&discordgo.WebhookEdit{
|
||||||
|
Embeds: &[]*discordgo.MessageEmbed{embed},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
_, err := databases.Database.Learns.InsertOne(context.TODO(), databases.InsertLearn{
|
_, err := databases.Database.Learns.InsertOne(context.TODO(), databases.InsertLearn{
|
||||||
Command: command,
|
Command: command,
|
||||||
Result: result,
|
Result: result,
|
||||||
|
|
|
@ -7,7 +7,7 @@ import (
|
||||||
"git.wh64.net/muffin/goMuffin/utils"
|
"git.wh64.net/muffin/goMuffin/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
const MUFFIN_VERSION = "5.1.0-gopher_dev.250517c"
|
const MUFFIN_VERSION = "5.1.1-gopher_release.250526a"
|
||||||
|
|
||||||
var updatedString string = utils.RegexpDecimals.FindAllStringSubmatch(MUFFIN_VERSION, -1)[3][0]
|
var updatedString string = utils.RegexpDecimals.FindAllStringSubmatch(MUFFIN_VERSION, -1)[3][0]
|
||||||
|
|
||||||
|
|
|
@ -59,16 +59,6 @@ func MessageCreate(s *discordgo.Session, m *discordgo.MessageCreate) {
|
||||||
args := argParser(content)
|
args := argParser(content)
|
||||||
command := commands.Discommand.Aliases[args[0]]
|
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 == "" {
|
if command == "" {
|
||||||
s.ChannelTyping(m.ChannelID)
|
s.ChannelTyping(m.ChannelID)
|
||||||
|
|
||||||
|
@ -158,6 +148,15 @@ func MessageCreate(s *discordgo.Session, m *discordgo.MessageCreate) {
|
||||||
commands.Discommand.MessageRun(command, s, m, args[1:])
|
commands.Discommand.MessageRun(command, s, m, args[1:])
|
||||||
return
|
return
|
||||||
} else {
|
} 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
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,6 +29,8 @@ func DBMigrate(n *commando.Node) error {
|
||||||
|
|
||||||
wg.Add(3)
|
wg.Add(3)
|
||||||
|
|
||||||
|
fmt.Println("[경고] 해당 명령어는 다음 버전에서 사라져요.")
|
||||||
|
|
||||||
// statement -> text
|
// statement -> text
|
||||||
go func() {
|
go func() {
|
||||||
defer wg.Done()
|
defer wg.Done()
|
||||||
|
|
Loading…
Reference in a new issue