-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #191 from beanbeanjuice/integration
Ready for Release v2.3.0
- Loading branch information
Showing
53 changed files
with
1,691 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/java/com/beanbeanjuice/command/cafe/BalanceCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/main/java/com/beanbeanjuice/command/cafe/ServeCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 75 additions & 0 deletions
75
src/main/java/com/beanbeanjuice/command/games/CoinFlipCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
package com.beanbeanjuice.command.games; | ||
|
||
import com.beanbeanjuice.main.CafeBot; | ||
import com.beanbeanjuice.utility.command.CommandContext; | ||
import com.beanbeanjuice.utility.command.ICommand; | ||
import com.beanbeanjuice.utility.command.usage.Usage; | ||
import com.beanbeanjuice.utility.command.usage.categories.CategoryType; | ||
import net.dv8tion.jda.api.entities.User; | ||
import net.dv8tion.jda.api.events.message.guild.GuildMessageReceivedEvent; | ||
|
||
import java.util.ArrayList; | ||
|
||
/** | ||
* An {@link ICommand} used for flipping coins. | ||
* | ||
* @author beanbeanjuice | ||
*/ | ||
public class CoinFlipCommand implements ICommand { | ||
|
||
@Override | ||
public void handle(CommandContext ctx, ArrayList<String> args, User user, GuildMessageReceivedEvent event) { | ||
int num = CafeBot.getGeneralHelper().getRandomNumber(1, 3); | ||
|
||
if (num == 1) { | ||
event.getChannel().sendMessage(CafeBot.getGeneralHelper().successEmbed( | ||
"Coin Toss!", | ||
"Heads" | ||
)).queue(); | ||
return; | ||
} | ||
|
||
if (num == 2) { | ||
event.getChannel().sendMessage(CafeBot.getGeneralHelper().successEmbed( | ||
"Coin Toss!", | ||
"Tails" | ||
)).queue(); | ||
return; | ||
} | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return "coin-flip"; | ||
} | ||
|
||
@Override | ||
public ArrayList<String> getAliases() { | ||
ArrayList<String> arrayList = new ArrayList<>(); | ||
arrayList.add("coinflip"); | ||
arrayList.add("coin-toss"); | ||
arrayList.add("cointoss"); | ||
return arrayList; | ||
} | ||
|
||
@Override | ||
public String getDescription() { | ||
return "Flip a coin!"; | ||
} | ||
|
||
@Override | ||
public String exampleUsage() { | ||
return "`!!coinflip`"; | ||
} | ||
|
||
@Override | ||
public Usage getUsage() { | ||
return new Usage(); | ||
} | ||
|
||
@Override | ||
public CategoryType getCategoryType() { | ||
return CategoryType.GAMES; | ||
} | ||
|
||
} |
87 changes: 87 additions & 0 deletions
87
src/main/java/com/beanbeanjuice/command/games/ConnectFourCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
package com.beanbeanjuice.command.games; | ||
|
||
import com.beanbeanjuice.main.CafeBot; | ||
import com.beanbeanjuice.utility.command.CommandContext; | ||
import com.beanbeanjuice.utility.command.ICommand; | ||
import com.beanbeanjuice.utility.command.usage.Usage; | ||
import com.beanbeanjuice.utility.command.usage.categories.CategoryType; | ||
import com.beanbeanjuice.utility.command.usage.types.CommandType; | ||
import com.beanbeanjuice.utility.sections.games.connectfour.ConnectFourGame; | ||
import net.dv8tion.jda.api.entities.User; | ||
import net.dv8tion.jda.api.events.message.guild.GuildMessageReceivedEvent; | ||
|
||
import java.util.ArrayList; | ||
|
||
/** | ||
* An {@link ICommand} used for Connect Four games. | ||
* | ||
* @author beanbeanjuice | ||
*/ | ||
public class ConnectFourCommand implements ICommand { | ||
|
||
@Override | ||
public void handle(CommandContext ctx, ArrayList<String> args, User user, GuildMessageReceivedEvent event) { | ||
User player1 = user; | ||
User player2 = CafeBot.getGeneralHelper().getUser(args.get(0)); | ||
|
||
if (player1.equals(player2)) { | ||
event.getChannel().sendMessage(CafeBot.getGeneralHelper().errorEmbed( | ||
"Cannot Play Yourself", | ||
"You cannot play a connect four game against yourself!" | ||
)).queue(); | ||
return; | ||
} | ||
|
||
if (player2.isBot()) { | ||
event.getChannel().sendMessage(CafeBot.getGeneralHelper().errorEmbed( | ||
"Cannot Play Against Bot", | ||
"You cannot play this game against a bot!" | ||
)).queue(); | ||
return; | ||
} | ||
|
||
ConnectFourGame game = new ConnectFourGame(player1, player2, event.getChannel()); | ||
if (!CafeBot.getConnectFourHandler().createGame(event.getGuild().getId(), game)) { | ||
event.getChannel().sendMessage(CafeBot.getGeneralHelper().errorEmbed( | ||
"Error Creating Connect Four Game", | ||
"There is already an active connect four game on this server. Please wait for it to end." | ||
)).queue(); | ||
} | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return "connect-four"; | ||
} | ||
|
||
@Override | ||
public ArrayList<String> getAliases() { | ||
ArrayList<String> arrayList = new ArrayList<>(); | ||
arrayList.add("connectfour"); | ||
arrayList.add("connect-4"); | ||
arrayList.add("connect4"); | ||
return arrayList; | ||
} | ||
|
||
@Override | ||
public String getDescription() { | ||
return "Play connect four with someone!"; | ||
} | ||
|
||
@Override | ||
public String exampleUsage() { | ||
return "`!!connect4 @beanbeanjuice`"; | ||
} | ||
|
||
@Override | ||
public Usage getUsage() { | ||
Usage usage = new Usage(); | ||
usage.addUsage(CommandType.USER, "Opponent Mention", true); | ||
return usage; | ||
} | ||
|
||
@Override | ||
public CategoryType getCategoryType() { | ||
return CategoryType.GAMES; | ||
} | ||
} |
66 changes: 66 additions & 0 deletions
66
src/main/java/com/beanbeanjuice/command/games/DiceRollCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
package com.beanbeanjuice.command.games; | ||
|
||
import com.beanbeanjuice.main.CafeBot; | ||
import com.beanbeanjuice.utility.command.CommandContext; | ||
import com.beanbeanjuice.utility.command.ICommand; | ||
import com.beanbeanjuice.utility.command.usage.Usage; | ||
import com.beanbeanjuice.utility.command.usage.categories.CategoryType; | ||
import com.beanbeanjuice.utility.command.usage.types.CommandType; | ||
import net.dv8tion.jda.api.entities.User; | ||
import net.dv8tion.jda.api.events.message.guild.GuildMessageReceivedEvent; | ||
|
||
import java.util.ArrayList; | ||
|
||
/** | ||
* An {@link ICommand} used for rolling dice. | ||
* | ||
* @author beanbeanjuice | ||
*/ | ||
public class DiceRollCommand implements ICommand { | ||
|
||
@Override | ||
public void handle(CommandContext ctx, ArrayList<String> args, User user, GuildMessageReceivedEvent event) { | ||
System.out.println(Integer.parseInt(args.get(0))); | ||
event.getChannel().sendMessage(CafeBot.getGeneralHelper().successEmbed( | ||
"Dice Roll!", | ||
"You rolled a `" + CafeBot.getGeneralHelper().getRandomNumber(1, Integer.parseInt(args.get(0)) + 1) + "`." | ||
)).queue(); | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return "dice-roll"; | ||
} | ||
|
||
@Override | ||
public ArrayList<String> getAliases() { | ||
ArrayList<String> arrayList = new ArrayList<>(); | ||
arrayList.add("diceroll"); | ||
arrayList.add("roll"); | ||
arrayList.add("dice"); | ||
return arrayList; | ||
} | ||
|
||
@Override | ||
public String getDescription() { | ||
return "Roll a dice between 1 and the specified number."; | ||
} | ||
|
||
@Override | ||
public String exampleUsage() { | ||
return "`!!roll 200`"; | ||
} | ||
|
||
@Override | ||
public Usage getUsage() { | ||
Usage usage = new Usage(); | ||
usage.addUsage(CommandType.NUMBER, "What number?", true); | ||
return usage; | ||
} | ||
|
||
@Override | ||
public CategoryType getCategoryType() { | ||
return CategoryType.GAMES; | ||
} | ||
|
||
} |
Oops, something went wrong.