feat: Discord basic implementation

This commit is contained in:
Matthew
2023-11-26 01:22:51 -05:00
parent 7e5fd73496
commit 33665130cf
4 changed files with 48 additions and 0 deletions

View File

@@ -1,6 +1,7 @@
package channelserver
import (
"crypto"
"encoding/hex"
"erupe-ce/common/byteframe"
"erupe-ce/common/mhfcourse"
@@ -318,6 +319,15 @@ func parseChatCommand(s *Session, command string) {
} else {
sendDisabledCommandMessage(s, commands["Teleport"])
}
case commands["Discord"].Prefix:
if commands["Discord"].Enabled {
token := crypto.MD5.New()
_, err := s.server.db.Exec("UPDATE users SET discord_token = ?", token)
if err != nil {
return
}
sendServerChatMessage(s, fmt.Sprintf(s.server.dict["commandDiscord"], token))
}
}
}