This repository has been archived by the owner on Dec 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 93
/
commands.go
90 lines (86 loc) · 2.7 KB
/
commands.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
package aternos_discord_bot
import "github.com/bwmarrin/discordgo"
const (
HelpCommand = "help"
PingCommand = "ping"
ConfigureCommand = "configure"
StartCommand = "start"
StopCommand = "stop"
StatusCommand = "status"
InfoCommand = "info"
PlayersCommand = "players"
SessionOption = "session"
ServerOption = "server"
)
var (
adminPermissions int64 = discordgo.PermissionManageServer
userPermissions int64 = discordgo.PermissionUseSlashCommands
dmPermission = false
)
// List of available discord commands.
var commands = []*discordgo.ApplicationCommand{
{
Name: ConfigureCommand,
Description: "Save configuration settings",
Options: []*discordgo.ApplicationCommandOption{
{
Name: SessionOption,
Description: "Set the ATERNOS_SESSION cookie value",
Type: discordgo.ApplicationCommandOptionString,
Required: true,
ChannelTypes: []discordgo.ChannelType{discordgo.ChannelTypeGuildText},
},
{
Name: ServerOption,
Description: "Set the ATERNOS_SERVER cookie value",
Type: discordgo.ApplicationCommandOptionString,
Required: true,
ChannelTypes: []discordgo.ChannelType{discordgo.ChannelTypeGuildText},
},
},
DefaultMemberPermissions: &adminPermissions,
DMPermission: &dmPermission,
},
{
Name: StartCommand,
Description: "Start the minecraft server",
DefaultMemberPermissions: &adminPermissions,
DMPermission: &dmPermission,
},
{
Name: StopCommand,
Description: "Stop the minecraft server",
DefaultMemberPermissions: &adminPermissions,
DMPermission: &dmPermission,
},
{
Name: PingCommand,
Description: "Check if the discord bot is still alive",
DefaultMemberPermissions: &userPermissions,
DMPermission: &dmPermission,
},
{
Name: StatusCommand,
Description: "Get the minecraft server status",
DefaultMemberPermissions: &userPermissions,
DMPermission: &dmPermission,
},
{
Name: InfoCommand,
Description: "Get detailed information about the minecraft server status",
DefaultMemberPermissions: &userPermissions,
DMPermission: &dmPermission,
},
{
Name: PlayersCommand,
Description: "List active players",
DefaultMemberPermissions: &userPermissions,
DMPermission: &dmPermission,
},
{
Name: HelpCommand,
Description: "Get help",
DefaultMemberPermissions: &adminPermissions,
DMPermission: &dmPermission,
},
}