Compare commits

8 Commits

Author SHA1 Message Date
Lee
7f935da4b4 add nerddetector command
All checks were successful
Deploy to Dokku / docker (ubuntu-latest) (push) Successful in 1m35s
2025-01-15 18:03:42 +00:00
Lee
f3aad3925a update ppize
All checks were successful
Deploy to Dokku / docker (ubuntu-latest) (push) Successful in 1m7s
2025-01-09 21:46:16 +00:00
Lee
ae741e1f13 oops
All checks were successful
Deploy to Dokku / docker (ubuntu-latest) (push) Successful in 1m40s
2025-01-09 21:40:11 +00:00
Lee
b78ef6e96c oops
All checks were successful
Deploy to Dokku / docker (ubuntu-latest) (push) Successful in 1m5s
2025-01-06 05:20:05 +00:00
Lee
d3661127cf update help cmd
All checks were successful
Deploy to Dokku / docker (ubuntu-latest) (push) Successful in 1m8s
2025-01-06 05:16:01 +00:00
Lee
fc1216be25 add how gay command
All checks were successful
Deploy to Dokku / docker (ubuntu-latest) (push) Successful in 1m44s
2025-01-06 05:03:24 +00:00
Lee
38089bdcd5 add how gay command 2025-01-06 05:03:10 +00:00
Lee
c424694068 update help cmd 2024-12-27 13:54:30 +00:00
5 changed files with 123 additions and 11 deletions

View File

@ -1,11 +1,9 @@
package cc.fascinated.bat.base; package cc.fascinated.bat.base;
import cc.fascinated.bat.base.commands.fun.*;
import cc.fascinated.bat.common.feature.Feature; import cc.fascinated.bat.common.feature.Feature;
import cc.fascinated.bat.common.feature.FeatureProfile; import cc.fascinated.bat.common.feature.FeatureProfile;
import cc.fascinated.bat.base.commands.botadmin.BotAdminCommand; import cc.fascinated.bat.base.commands.botadmin.BotAdminCommand;
import cc.fascinated.bat.base.commands.fun.CoinFlipCommand;
import cc.fascinated.bat.base.commands.fun.EightBallCommand;
import cc.fascinated.bat.base.commands.fun.PPSizeCommand;
import cc.fascinated.bat.base.commands.fun.image.ImageCommand; import cc.fascinated.bat.base.commands.fun.image.ImageCommand;
import cc.fascinated.bat.base.commands.general.*; import cc.fascinated.bat.base.commands.general.*;
import cc.fascinated.bat.base.commands.general.avatar.AvatarCommand; import cc.fascinated.bat.base.commands.general.avatar.AvatarCommand;
@ -49,5 +47,7 @@ public class BaseFeature extends Feature {
super.registerCommand(commandService, context.getBean(PPSizeCommand.class)); super.registerCommand(commandService, context.getBean(PPSizeCommand.class));
super.registerCommand(commandService, context.getBean(PastebinCommand.class)); super.registerCommand(commandService, context.getBean(PastebinCommand.class));
super.registerCommand(commandService, context.getBean(CoinFlipCommand.class)); super.registerCommand(commandService, context.getBean(CoinFlipCommand.class));
super.registerCommand(commandService, context.getBean(HowGayCommand.class));
super.registerCommand(commandService, context.getBean(NerdDetectorCommand.class));
} }
} }

View File

@ -0,0 +1,52 @@
package cc.fascinated.bat.base.commands.fun;
import cc.fascinated.bat.common.DescriptionBuilder;
import cc.fascinated.bat.common.EmbedUtils;
import cc.fascinated.bat.common.MathUtils;
import cc.fascinated.bat.common.command.BatCommand;
import cc.fascinated.bat.common.command.Category;
import cc.fascinated.bat.common.command.CommandInfo;
import cc.fascinated.bat.common.model.BatGuild;
import cc.fascinated.bat.common.model.BatUser;
import lombok.NonNull;
import net.dv8tion.jda.api.entities.Member;
import net.dv8tion.jda.api.entities.Message;
import net.dv8tion.jda.api.entities.User;
import net.dv8tion.jda.api.entities.channel.middleman.MessageChannel;
import net.dv8tion.jda.api.interactions.commands.OptionMapping;
import net.dv8tion.jda.api.interactions.commands.OptionType;
import net.dv8tion.jda.api.interactions.commands.SlashCommandInteraction;
import net.dv8tion.jda.api.interactions.commands.build.OptionData;
import org.springframework.stereotype.Component;
/**
* @author Fascinated (fascinated7)
*/
@Component
@CommandInfo(
name = "howgay",
description = "Checks how gay someone is",
userInstall = true,
category = Category.FUN
)
public class HowGayCommand extends BatCommand {
public HowGayCommand() {
super.addOptions(new OptionData(OptionType.USER, "user", "The user you want to check the gayness of", true));
}
@Override
public void execute(BatGuild guild, @NonNull BatUser user, @NonNull MessageChannel channel, Member member, Message commandMessage, String[] arguments, SlashCommandInteraction event) {
OptionMapping userOption = event.getOption("user");
assert userOption != null; // This should never be null
User target = userOption.getAsUser();
event.replyEmbeds(EmbedUtils.genericEmbed()
.setDescription(new DescriptionBuilder("How Gay?")
.appendLine("%s is %s%% gay".formatted(
target.getAsMention(),
(int) MathUtils.random(0, 100)
), false)
.build())
.build()).queue();
}
}

View File

@ -0,0 +1,52 @@
package cc.fascinated.bat.base.commands.fun;
import cc.fascinated.bat.common.DescriptionBuilder;
import cc.fascinated.bat.common.EmbedUtils;
import cc.fascinated.bat.common.MathUtils;
import cc.fascinated.bat.common.command.BatCommand;
import cc.fascinated.bat.common.command.Category;
import cc.fascinated.bat.common.command.CommandInfo;
import cc.fascinated.bat.common.model.BatGuild;
import cc.fascinated.bat.common.model.BatUser;
import lombok.NonNull;
import net.dv8tion.jda.api.entities.Member;
import net.dv8tion.jda.api.entities.Message;
import net.dv8tion.jda.api.entities.User;
import net.dv8tion.jda.api.entities.channel.middleman.MessageChannel;
import net.dv8tion.jda.api.interactions.commands.OptionMapping;
import net.dv8tion.jda.api.interactions.commands.OptionType;
import net.dv8tion.jda.api.interactions.commands.SlashCommandInteraction;
import net.dv8tion.jda.api.interactions.commands.build.OptionData;
import org.springframework.stereotype.Component;
/**
* @author Fascinated (fascinated7)
*/
@Component
@CommandInfo(
name = "nerddetector",
description = "Checks how much of a nerd someone is",
userInstall = true,
category = Category.FUN
)
public class NerdDetectorCommand extends BatCommand {
public NerdDetectorCommand() {
super.addOptions(new OptionData(OptionType.USER, "user", "The user you want to check how much of a nerd they are", true));
}
@Override
public void execute(BatGuild guild, @NonNull BatUser user, @NonNull MessageChannel channel, Member member, Message commandMessage, String[] arguments, SlashCommandInteraction event) {
OptionMapping userOption = event.getOption("user");
assert userOption != null; // This should never be null
User target = userOption.getAsUser();
event.replyEmbeds(EmbedUtils.genericEmbed()
.setDescription(new DescriptionBuilder("Nerd Detector")
.appendLine("%s is %s%% nerd 🤓".formatted(
target.getAsMention(),
(int) MathUtils.random(0, 100)
), false)
.build())
.build()).queue();
}
}

View File

@ -30,6 +30,7 @@ import org.springframework.stereotype.Component;
category = Category.FUN category = Category.FUN
) )
public class PPSizeCommand extends BatCommand { public class PPSizeCommand extends BatCommand {
public PPSizeCommand() { public PPSizeCommand() {
super.addOptions(new OptionData(OptionType.USER, "user", "The user you want to get the pp size of", true)); super.addOptions(new OptionData(OptionType.USER, "user", "The user you want to get the pp size of", true));
} }
@ -40,15 +41,17 @@ public class PPSizeCommand extends BatCommand {
assert userOption != null; // This should never be null assert userOption != null; // This should never be null
User target = userOption.getAsUser(); User target = userOption.getAsUser();
int size = (int) MathUtils.random(1, 12); int maxSize = 12;
int size = (int) MathUtils.random(1, maxSize);
event.replyEmbeds(EmbedUtils.genericEmbed() event.replyEmbeds(EmbedUtils.genericEmbed()
.setDescription(new DescriptionBuilder("PP Size") .setDescription(new DescriptionBuilder("PP Size")
.appendLine(""" .appendLine("""
The size of %s's pp is %s inches The size of %s's pp is %s inches%s
**8%sD** **8%sD**
""".formatted( """.formatted(
target.getAsMention(), target.getAsMention(),
size, size,
size == maxSize ? " 😳" : "",
"=".repeat(size) "=".repeat(size)
), false) ), false)
.build()) .build())

View File

@ -88,7 +88,10 @@ public class HelpCommand extends BatCommand implements EventListener {
} }
event.replyEmbeds(createHomeEmbed(event.isFromGuild())).addComponents(interactionBuilder.build()).queue(); event.replyEmbeds(createHomeEmbed(event.isFromGuild()))
.addComponents(interactionBuilder.build())
.setEphemeral(true)
.queue();
} }
/** /**
@ -103,7 +106,7 @@ public class HelpCommand extends BatCommand implements EventListener {
continue; continue;
} }
long commandCount = commandService.getCommandsByCategory(category, ranInsideGuild).size(); long commandCount = commandService.getCommandsByCategory(category, ranInsideGuild).size();
categories.append("➜ %s - **%s Command%s**\n".formatted( categories.append("- %s: **%s Command%s**\n".formatted(
category.getName(), category.getName(),
commandCount, commandCount,
commandCount == 1 ? "" : "s" commandCount == 1 ? "" : "s"
@ -112,13 +115,15 @@ public class HelpCommand extends BatCommand implements EventListener {
return EmbedUtils.genericEmbed() return EmbedUtils.genericEmbed()
.setDescription(""" .setDescription("""
**Welcome to the Bat Help Menu!**%s **Welcome to the Bat Help Menu!**
%s Bat is a multi-purpose bot that has a variety of features to help you with your server. You can change the category be clicking on the category name in the list below.
%s%s
*View our [TOS](%s) and [Privacy Policy](%s) for more information.* *View our [TOS](%s) and [Privacy Policy](%s) for more information.*
""".formatted( """.formatted(
!ranInsideGuild ? "\n*guild only commands won't be shown here*" : "",
categories.toString(), categories.toString(),
!ranInsideGuild ? "\n*guild only commands won't be shown here*" : "",
Consts.TERMS_OF_SERVICE_URL, Consts.TERMS_OF_SERVICE_URL,
Consts.PRIVACY_POLICY_URL Consts.PRIVACY_POLICY_URL
)) ))