53 lines
1.3 KiB
Go
53 lines
1.3 KiB
Go
package commands
|
|
|
|
import (
|
|
"github.com/disgoorg/disgo/discord"
|
|
"github.com/disgoorg/json"
|
|
)
|
|
|
|
func getPingCommand() discord.SlashCommandCreate {
|
|
return discord.SlashCommandCreate{
|
|
Name: "ping",
|
|
Description: "Check whether the bot is responding.",
|
|
}
|
|
}
|
|
|
|
func getSyncCommand() discord.SlashCommandCreate {
|
|
perms := json.NewNullable(discord.PermissionManageChannels)
|
|
|
|
return discord.SlashCommandCreate{
|
|
Name: "sync",
|
|
Description: "Register/remove a channel to sync.",
|
|
DefaultMemberPermissions: &perms,
|
|
Options: []discord.ApplicationCommandOption{
|
|
discord.ApplicationCommandOptionSubCommand{
|
|
Name: "register",
|
|
Description: "Register a channel for logging",
|
|
Options: []discord.ApplicationCommandOption{
|
|
discord.ApplicationCommandOptionChannel{
|
|
Name: "channel",
|
|
Description: "Channel to register",
|
|
Required: true,
|
|
},
|
|
},
|
|
},
|
|
discord.ApplicationCommandOptionSubCommand{
|
|
Name: "remove",
|
|
Description: "Remove a channel from logging",
|
|
Options: []discord.ApplicationCommandOption{
|
|
discord.ApplicationCommandOptionChannel{
|
|
Name: "channel",
|
|
Description: "Channel to remove",
|
|
Required: true,
|
|
},
|
|
},
|
|
},
|
|
},
|
|
}
|
|
}
|
|
|
|
var Commands = []discord.ApplicationCommandCreate{
|
|
getPingCommand(),
|
|
getSyncCommand(),
|
|
}
|