feat: Generate hashes for Discord and allow password resets

This commit is contained in:
Matthew
2023-11-26 16:47:54 -05:00
parent 50946b9c68
commit 226adddc43
8 changed files with 100 additions and 46 deletions

32
main.go
View File

@@ -3,6 +3,7 @@ package main
import (
_config "erupe-ce/config"
"fmt"
"github.com/bwmarrin/discordgo"
"net"
"os"
"os/signal"
@@ -98,6 +99,37 @@ func main() {
}
discordBot = bot
_, err = discordBot.Session.ApplicationCommandBulkOverwrite(discordBot.Session.State.User.ID, "", []*discordgo.ApplicationCommand{
{
Name: "verify",
Description: "Verify your account with Discord",
Options: []*discordgo.ApplicationCommandOption{
{
Type: discordgo.ApplicationCommandOptionString,
Name: "token",
Description: "The access token provided by !discord command within the game client.",
Required: true,
},
},
},
{
Name: "passwordreset",
Description: "Reset your account password on Erupe",
Options: []*discordgo.ApplicationCommandOption{
{
Type: discordgo.ApplicationCommandOptionString,
Name: "password",
Description: "The password to change your account to.",
Required: true,
},
},
},
})
if err != nil {
preventClose(fmt.Sprintf("Discord: Failed to start, %s", err.Error()))
}
logger.Info("Discord: Started successfully")
} else {
logger.Info("Discord: Disabled")