Skip to content

Commit

Permalink
fixes #51 only if people were good at chess this would have been the …
Browse files Browse the repository at this point in the history
…most easy good first ever, but good chess players are taking each other down, and there is me making this kind of issues

¯\_(ツ)_/¯
  • Loading branch information
jalpp authored May 4, 2024
1 parent c77b21e commit fafba97
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/main/java/Discord/HelperModules/ButtonHelperContextModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -175,14 +175,18 @@ public void handlePuzzleButtons(ButtonInteractionEvent buttonEvent, DailyCommand

public void handleLearnCommand(ButtonInteractionEvent buttonEvent, CommandInfo commandInfo) {


switch (buttonEvent.getComponentId()) {
case "next" -> buttonEvent.editMessageEmbeds(commandInfo.getPageTwo().build()).setActionRow(net.dv8tion.jda.api.interactions.components.buttons.Button.primary("nexttwo", "➡️"), net.dv8tion.jda.api.interactions.components.buttons.Button.link("https://discord.gg/K2NKarM5KV", "Support Server")).queue();
case "nexttwo" -> buttonEvent.editMessageEmbeds(commandInfo.getPageThree().build()).setActionRow(net.dv8tion.jda.api.interactions.components.buttons.Button.primary("nextthree", "➡️").asDisabled(), Button.link("https://discord.gg/K2NKarM5KV", "Support Server")).queue();
case "Bishop" -> buttonEvent.editMessageEmbeds(commandInfo.getPageFive().build()).setActionRow(net.dv8tion.jda.api.interactions.components.buttons.Button.primary("Rook", "⬅️"), net.dv8tion.jda.api.interactions.components.buttons.Button.primary("Knight", "♞"), Button.link("https://discord.gg/K2NKarM5KV", "Support Server")).queue();
case "Knight" -> buttonEvent.editMessageEmbeds(commandInfo.getPageSix().build()).setActionRow(net.dv8tion.jda.api.interactions.components.buttons.Button.primary("Bishop", "⬅️"), net.dv8tion.jda.api.interactions.components.buttons.Button.primary("Queen", "♛"), Button.link("https://discord.gg/K2NKarM5KV", "Support Server")).queue();
case "Queen" -> buttonEvent.editMessageEmbeds(commandInfo.getPageSeven().build()).setActionRow(net.dv8tion.jda.api.interactions.components.buttons.Button.primary("Knight", "⬅️"), Button.link("https://discord.gg/K2NKarM5KV", "Support Server")).queue();
case "Rook" -> buttonEvent.editMessageEmbeds(commandInfo.getPageFour().build()).setActionRow(net.dv8tion.jda.api.interactions.components.buttons.Button.primary("Bishop", "♝"), Button.link("https://discord.gg/K2NKarM5KV", "Support Server")).queue();
case "next" -> buttonEvent.editMessageEmbeds(commandInfo.getPageTwo().build()).setActionRow(net.dv8tion.jda.api.interactions.components.buttons.Button.primary("nexttwo", "➡️")).queue();
case "nexttwo" -> buttonEvent.editMessageEmbeds(commandInfo.getPageThree().build()).setActionRow(net.dv8tion.jda.api.interactions.components.buttons.Button.primary("nextthree", "➡️").asDisabled()).queue();
case "Bishop" -> buttonEvent.editMessageEmbeds(commandInfo.getPageFive().build()).setActionRow(net.dv8tion.jda.api.interactions.components.buttons.Button.primary("Rook", "⬅️"), net.dv8tion.jda.api.interactions.components.buttons.Button.primary("Knight", "♞")).queue();
case "Knight" -> buttonEvent.editMessageEmbeds(commandInfo.getPageSix().build()).setActionRow(net.dv8tion.jda.api.interactions.components.buttons.Button.primary("Bishop", "⬅️"), net.dv8tion.jda.api.interactions.components.buttons.Button.primary("Queen", "♛")).queue();
case "Queen" -> buttonEvent.editMessageEmbeds(commandInfo.getPageSeven().build()).setActionRow(net.dv8tion.jda.api.interactions.components.buttons.Button.primary("Knight", "⬅️"), Button.primary("King", "♚")).queue();
case "Rook" -> buttonEvent.editMessageEmbeds(commandInfo.getPageFour().build()).setActionRow(net.dv8tion.jda.api.interactions.components.buttons.Button.primary("Bishop", "♝")).queue();
case "King" -> buttonEvent.editMessageEmbeds(commandInfo.getPageEight().build()).setActionRow(Button.primary("Queen", "⬅️"), Button.primary("King-castle", "Castle ♚")).queue();
case "King-castle" -> buttonEvent.editMessageEmbeds(commandInfo.getPageNine().build()).setActionRow(Button.primary("king","⬅️" ), Button.primary("Pawn", "♟️")).queue();
case "Pawn" -> buttonEvent.editMessageEmbeds(commandInfo.getPageTen().build()).setActionRow(Button.primary("King-castle","⬅️" ), Button.primary("Pawn-en", "En-passant ♟️")).queue();
case "Pawn-en" -> buttonEvent.editMessageEmbeds(commandInfo.getPageEleven().build()).setActionRow(Button.primary("Pawn-en", "⬅️"), Button.primary("Pawn-pro", "Promotion ♟️")).queue();
case "Pawn-pro" -> buttonEvent.editMessageEmbeds(commandInfo.getPage12().build()).setActionRow(Button.primary("Pawn-pro", "All set for chess!").asDisabled()).queue();

}

Expand Down
49 changes: 49 additions & 0 deletions src/main/java/Discord/MainHandler/CommandInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,55 @@ public EmbedBuilder getPageSeven() {
return this.embedBuilder;
}

public EmbedBuilder getPageEight() {
this.embedBuilder.setColor(Color.blue);
this.embedBuilder.setThumbnail(this.logo);
this.embedBuilder.setDescription("Here are the basic moves of the King:\n\n");
this.embedBuilder.appendDescription("""
**King:** Move 1 square at a time horizontally, vertically, or diagonally.
""");
this.embedBuilder.setImage("https://images.chesscomfiles.com/uploads/v1/images_users/tiny_mce/pdrpnht/phpmVRKYr.png");
this.embedBuilder.setFooter("Join our Server - https://discord.gg/uncmhknmYg ♟\uFE0F");
return this.embedBuilder;
}

public EmbedBuilder getPageNine() {
this.embedBuilder.setColor(Color.blue);
this.embedBuilder.setThumbnail(this.logo);
this.embedBuilder.setDescription("King Special move: castling, when king and rook gets space between his king and the rooks and no piece are present he can castle that way:\n\n");
this.embedBuilder.setImage("https://www.chessbazaar.com/blog/wp-content/uploads/2014/11/castling.gif");
this.embedBuilder.setFooter("Join our Server - https://discord.gg/uncmhknmYg ♟\uFE0F");
return this.embedBuilder;
}

public EmbedBuilder getPageTen() {
this.embedBuilder.setColor(Color.blue);
this.embedBuilder.setThumbnail(this.logo);
this.embedBuilder.setDescription("Pawn Move: can only go up the board and capture on the flank side:\n\n");
this.embedBuilder.setImage("https://images.chesscomfiles.com/uploads/v1/images_users/tiny_mce/pdrpnht/php8nbVYg.gif");
this.embedBuilder.setFooter("Join our Server - https://discord.gg/uncmhknmYg ♟\uFE0F");
return this.embedBuilder;
}

public EmbedBuilder getPageEleven() {
this.embedBuilder.setColor(Color.blue);
this.embedBuilder.setThumbnail(this.logo);
this.embedBuilder.setDescription("Pawn Special Move: en-passant capture when opposing side moves side pawn beside your pawn :\n\n");
this.embedBuilder.setImage("https://images.chesscomfiles.com/uploads/v1/images_users/tiny_mce/pdrpnht/phpZmdTyW.gif");
this.embedBuilder.setFooter("Join our Server - https://discord.gg/uncmhknmYg ♟\uFE0F");
return this.embedBuilder;
}

public EmbedBuilder getPage12() {
this.embedBuilder.setColor(Color.blue);
this.embedBuilder.setThumbnail(this.logo);
this.embedBuilder.setDescription("Pawn Special Move: Promotion, when your pawn reaches the 8th rank you can promote to queen,rook,bishop, or a night :\n\n");
this.embedBuilder.setImage("https://images.chesscomfiles.com/uploads/v1/images_users/tiny_mce/PedroPinhata/phpFSZHst.gif");
this.embedBuilder.setFooter("Join our Server - https://discord.gg/uncmhknmYg ♟\uFE0F");
return this.embedBuilder;
}



public void sendCommunityCommand(SlashCommandInteractionEvent slashEvent) {
EmbedBuilder embedBuilder = new EmbedBuilder();
Expand Down

0 comments on commit fafba97

Please sign in to comment.