Skip to content

Commit

Permalink
Added the Hide Command
Browse files Browse the repository at this point in the history
  • Loading branch information
beanbeanjuice committed Aug 13, 2024
1 parent d7107ed commit b76e88a
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 1 deletion.
2 changes: 2 additions & 0 deletions bot/src/main/java/com/beanbeanjuice/cafebot/CafeBot.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ public class CafeBot {
@Getter private int commandsRun = 0;
@Getter private final String discordAvatarUrl = "https://cdn.beanbeanjuice.com/images/cafeBot/cafeBot.gif";

// TODO: Store mutual guilds in database.
public CafeBot() throws InterruptedException {
this.logger = new LogManager(
this,
Expand Down Expand Up @@ -225,6 +226,7 @@ private void setupCommands() {
new DieCommand(this),
new GreetCommand(this),
new HeadPatCommand(this),
new HideCommand(this),
new HmphCommand(this),
new HugCommand(this),
new KissCommand(this),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
package com.beanbeanjuice.cafebot.commands.interaction;

import com.beanbeanjuice.cafeapi.wrapper.endpoints.interactions.InteractionType;
import com.beanbeanjuice.cafebot.CafeBot;
import com.beanbeanjuice.cafebot.utility.commands.Command;
import com.beanbeanjuice.cafebot.utility.commands.CommandCategory;
import com.beanbeanjuice.cafebot.utility.commands.ICommand;
import com.beanbeanjuice.cafebot.utility.sections.interactions.ICommandInteraction;
import net.dv8tion.jda.api.Permission;
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;

public class HideCommand extends Command implements ICommand, ICommandInteraction {

public HideCommand(final CafeBot cafeBot) {
super(cafeBot);
}

@Override
public void handle(SlashCommandInteractionEvent event) {
this.handleInteraction(InteractionType.HIDE, event, this.cafeBot);
}

@Override
public String getName() {
return "hide";
}

@Override
public String getDescription() {
return "Hide from someone... ;^;";
}

@Override
public CommandCategory getCategory() {
return CommandCategory.INTERACTION;
}

@Override
public OptionData[] getOptions() {
return new OptionData[] {
new OptionData(OptionType.USER, "user", "The user you want to hide from..."),
new OptionData(OptionType.STRING, "message", "An optional message you can send.")
};
}

@Override
public Permission[] getPermissions() {
return new Permission[0];
}

@Override
public boolean isEphemeral() {
return false;
}

@Override
public boolean isNSFW() {
return false;
}

@Override
public boolean allowDM() {
return true;
}

@Override
public String getSelfString() {
return "%s is **hiding** for... no reason? What? <:kuromi_question:841921649132568576>";
}

@Override
public String getOtherString() {
return "%s is **hiding** from %s! Um... what did you do? <:kuromi_question:841921649132568576>";
}

@Override
public String getBotString() {
return "Why are you hiding from me?! Come back! <:cafeBot_angry:1171726164092518441>";
}

@Override
public String getFooterString() {
return "%s hid from others %d times. %s caused others to hide %d times.";
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ public enum InteractionType {
NOSEBLEED ("nosebleed_amount", "nosebleed"),
OK ("ok_amount", "ok"),
UWU ("uwu_amount", "uwu"),
WINK ("wink_amount", "wink");
WINK ("wink_amount", "wink"),
HIDE ("hide_amount", "hide");

@Getter private final String type;
private final String kawaiiAPIString;
Expand Down

0 comments on commit b76e88a

Please sign in to comment.