mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-12 23:14:36 +01:00
feat: Generate hashes for Discord and allow password resets
This commit is contained in:
32
main.go
32
main.go
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user