mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-14 07:55:33 +01:00
feat: Finish help command and add description to commands.
This commit is contained in:
@@ -82,35 +82,43 @@
|
|||||||
{
|
{
|
||||||
"Name": "Help",
|
"Name": "Help",
|
||||||
"Enabled": true,
|
"Enabled": true,
|
||||||
|
"Description": "Show all of the commands",
|
||||||
"Prefix": "help"
|
"Prefix": "help"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Name": "Rights",
|
"Name": "Rights",
|
||||||
"Enabled": false,
|
"Enabled": false,
|
||||||
|
"Description": "Directly alter user's applied courses.",
|
||||||
"Prefix": "rights"
|
"Prefix": "rights"
|
||||||
}, {
|
}, {
|
||||||
"Name": "Raviente",
|
"Name": "Raviente",
|
||||||
"Enabled": true,
|
"Enabled": true,
|
||||||
|
"Description": "Start or view an ongoing raviante raid.",
|
||||||
"Prefix": "ravi"
|
"Prefix": "ravi"
|
||||||
}, {
|
}, {
|
||||||
"Name": "Teleport",
|
"Name": "Teleport",
|
||||||
"Enabled": false,
|
"Enabled": false,
|
||||||
|
"Description": "Teleport to a specified stage.",
|
||||||
"Prefix": "tele"
|
"Prefix": "tele"
|
||||||
}, {
|
}, {
|
||||||
"Name": "Reload",
|
"Name": "Reload",
|
||||||
"Enabled": true,
|
"Enabled": true,
|
||||||
|
"Description": "Reload all user sessions (Forces log out)",
|
||||||
"Prefix": "reload"
|
"Prefix": "reload"
|
||||||
}, {
|
}, {
|
||||||
"Name": "KeyQuest",
|
"Name": "KeyQuest",
|
||||||
"Enabled": false,
|
"Enabled": false,
|
||||||
|
"Description": "Allow the overriding of necessary key quests.",
|
||||||
"Prefix": "kqf"
|
"Prefix": "kqf"
|
||||||
}, {
|
}, {
|
||||||
"Name": "Course",
|
"Name": "Course",
|
||||||
"Enabled": true,
|
"Enabled": true,
|
||||||
|
"Description": "Apply/remove user courses based on the name.",
|
||||||
"Prefix": "course"
|
"Prefix": "course"
|
||||||
}, {
|
}, {
|
||||||
"Name": "PSN",
|
"Name": "PSN",
|
||||||
"Enabled": true,
|
"Enabled": true,
|
||||||
|
"Description": "Link a PSN account to your Erupe account.",
|
||||||
"Prefix": "psn"
|
"Prefix": "psn"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -171,6 +171,7 @@ type Discord struct {
|
|||||||
type Command struct {
|
type Command struct {
|
||||||
Name string
|
Name string
|
||||||
Enabled bool
|
Enabled bool
|
||||||
|
Description string
|
||||||
Prefix string
|
Prefix string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import (
|
|||||||
"erupe-ce/network/binpacket"
|
"erupe-ce/network/binpacket"
|
||||||
"erupe-ce/network/mhfpacket"
|
"erupe-ce/network/mhfpacket"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"golang.org/x/exp/maps"
|
||||||
"golang.org/x/exp/slices"
|
"golang.org/x/exp/slices"
|
||||||
"math"
|
"math"
|
||||||
"strconv"
|
"strconv"
|
||||||
@@ -320,7 +321,9 @@ func parseChatCommand(s *Session, command string) {
|
|||||||
}
|
}
|
||||||
case commands["Help"].Prefix:
|
case commands["Help"].Prefix:
|
||||||
if commands["Help"].Enabled {
|
if commands["Help"].Enabled {
|
||||||
sendServerChatMessage(s, fmt.Sprintf(s.server.dict["commandTeleportSuccess"], x, y))
|
for _, command := range maps.Values(commands) {
|
||||||
|
sendServerChatMessage(s, fmt.Sprintf("%s: %s", command.Name, command.Description))
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
sendDisabledCommandMessage(s, commands["Help"])
|
sendDisabledCommandMessage(s, commands["Help"])
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user