Compare commits
8 Commits
new-comman
...
master
Author | SHA1 | Date | |
---|---|---|---|
7f935da4b4 | |||
f3aad3925a | |||
ae741e1f13 | |||
b78ef6e96c | |||
d3661127cf | |||
fc1216be25 | |||
38089bdcd5 | |||
c424694068 |
@ -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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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();
|
||||||
|
}
|
||||||
|
}
|
@ -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();
|
||||||
|
}
|
||||||
|
}
|
@ -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())
|
||||||
|
@ -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
|
||||||
))
|
))
|
||||||
|
Reference in New Issue
Block a user