Skip to content

Commit

Permalink
added new command
Browse files Browse the repository at this point in the history
  • Loading branch information
Paranoia8972 committed Nov 29, 2024
1 parent 39a7c7f commit e26a3ff
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 6 deletions.
38 changes: 32 additions & 6 deletions internal/pkg/commands/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -374,9 +374,8 @@ func RegisterCommands(s *discordgo.Session, cfg *config.Config) {
},
},
{
Name: "level",
Description: "Get your current level and XP",
DefaultMemberPermissions: &[]int64{discordgo.PermissionViewChannel}[0],
Name: "level",
Description: "Get your current level and XP",
Options: []*discordgo.ApplicationCommandOption{
{
Name: "user",
Expand All @@ -387,9 +386,8 @@ func RegisterCommands(s *discordgo.Session, cfg *config.Config) {
},
},
{
Name: "mcstatus",
Description: "Get the status of the Minecraft server",
DefaultMemberPermissions: &[]int64{discordgo.PermissionViewChannel}[0],
Name: "mcstatus",
Description: "Get the status of the Minecraft server",
Options: []*discordgo.ApplicationCommandOption{
{
Name: "server_ip",
Expand Down Expand Up @@ -451,6 +449,34 @@ func RegisterCommands(s *discordgo.Session, cfg *config.Config) {
},
},
},
{
Name: "coinflip",
Description: "Flip a coin",
},
{
Name: "randomnumber",
Description: "Generate a random number",
Options: []*discordgo.ApplicationCommandOption{
{
Name: "max",
Description: "Maximum number to generate",
Type: discordgo.ApplicationCommandOptionInteger,
Required: true,
},
},
},
{
Name: "chooser",
Description: "Choose a random item from a list",
Options: []*discordgo.ApplicationCommandOption{
{
Name: "items",
Description: "List of items to choose from, seperated by commas",
Type: discordgo.ApplicationCommandOptionString,
Required: true,
},
},
},
}

commands := make([]*discordgo.ApplicationCommand, len(Commands))
Expand Down
8 changes: 8 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,20 @@ func main() {
commands.GiveawayCommand(s, i)
case "edit":
commands.EditCommand(s, i)
case "level":
commands.LevelCommand(s, i)

Check failure on line 77 in main.go

View workflow job for this annotation

GitHub Actions / build

undefined: commands.LevelCommand
case "mcstatus":
commands.MinecraftStatusCommand(s, i)
case "ban":
moderation.BanCommand(s, i)
case "unban":
moderation.UnbanCommand(s, i)
case "coinflip":
commands.CoinFlipCommand(s, i)
case "randomnumber":
commands.RandomNumberCommand(s, i)
case "chooser":
commands.ChooserCommand(s, i)
}
}
})
Expand Down

0 comments on commit e26a3ff

Please sign in to comment.