Skip to content

Commit

Permalink
Added Basics for Team Command
Browse files Browse the repository at this point in the history
  • Loading branch information
beanbeanjuice committed Oct 16, 2023
1 parent 3559f11 commit 095b4bd
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ As you can see, this was shown using the command `/help order`. It shows each pa
* `rate` - Rate the percentages of someone! (*somewhat* NSFW)
* `snipe` - Snipe a recently deleted message! (30 Seconds)
* `tea-meme` - Get a tea meme!
* `team` - Choose and split up teams fairly.
* `8ball` - Ask a yes or no question!
##### 4. **GAMES**
* `coin-flip` - Flip a coin!
Expand Down
57 changes: 57 additions & 0 deletions src/main/java/com/beanbeanjuice/command/fun/TeamCommand.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
package com.beanbeanjuice.command.fun;

import com.beanbeanjuice.utility.command.CommandCategory;
import com.beanbeanjuice.utility.command.ICommand;
import net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent;
import net.dv8tion.jda.api.interactions.commands.OptionType;
import net.dv8tion.jda.api.interactions.commands.build.OptionData;
import org.jetbrains.annotations.NotNull;

import java.util.ArrayList;

/**
* An {@link ICommand} used to choose/make teams.
*
* @author beanbeanjuice
*/
public class TeamCommand implements ICommand {

@Override
public void handle(@NotNull SlashCommandInteractionEvent event) {

// TODO: Default - Any amount of users.
// TODO: Allow infinite players if no player amount specified.
// TODO: Default - 2 teams

}

@NotNull
@Override
public String getDescription() {
return null;
}

@NotNull
@Override
public String exampleUsage() {
return "`/team` or `/team 5` or `/team 5 2`";
}

@NotNull
@Override
public ArrayList<OptionData> getOptions() {
ArrayList<OptionData> options = new ArrayList<>();

options.add(new OptionData(OptionType.INTEGER, "players", "The amount of players per team.", false));
options.add(new OptionData(OptionType.INTEGER, "teams", "The number of teams.", false));

return options;
}

@NotNull
@Override
public CommandCategory getCategoryType() {
return CommandCategory.FUN;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ public CommandHandler(@NotNull JDA jda) {
commands.put("meme", new MemeCommand());
commands.put("snipe", new SnipeCommand());
commands.put("tea-meme", new TeaMemeCommand());
commands.put("team", new TeamCommand());
commands.put("8ball", new EightBallCommand());

// Games
Expand Down

0 comments on commit 095b4bd

Please sign in to comment.