use of uwu.narumi.tama.command.CommandException in project TamaBot by Loli-Cafe.
the class HandJobCommand method compose.
@Override
public void compose(MessageReceivedEvent event, String... args) {
checkContext(event.getMember(), event.getTextChannel());
if (!DiscordHelper.hasMention(event, Message.MentionType.USER))
throw new CommandException(getUsage());
event.getTextChannel().sendMessageEmbeds(execute(String.format("%s gave %s handjob", event.getAuthor().getAsMention(), DiscordHelper.getMention(event, Message.MentionType.USER).getAsMention()))).queue();
}
use of uwu.narumi.tama.command.CommandException in project TamaBot by Loli-Cafe.
the class HandJobCommand method compose.
@Override
public void compose(SlashCommandInteractionEvent event) {
checkContext(event.getMember(), event.getTextChannel());
OptionMapping optionMapping = event.getOption("user");
if (optionMapping == null)
throw new CommandException(getUsage());
event.replyEmbeds(execute(String.format("%s gave %s handjob", event.getUser().getAsMention(), optionMapping.getAsUser().getAsMention()))).queue();
}
use of uwu.narumi.tama.command.CommandException in project TamaBot by Loli-Cafe.
the class LickNipplesCommand method compose.
@Override
public void compose(MessageReceivedEvent event, String... args) {
checkContext(event.getMember(), event.getTextChannel());
if (!DiscordHelper.hasMention(event, Message.MentionType.USER))
throw new CommandException(getUsage());
event.getTextChannel().sendMessageEmbeds(execute(String.format("%s licked %s nipples", event.getAuthor().getAsMention(), DiscordHelper.getMention(event, Message.MentionType.USER).getAsMention()))).queue();
}
use of uwu.narumi.tama.command.CommandException in project TamaBot by Loli-Cafe.
the class StepCommand method compose.
@Override
public void compose(SlashCommandInteractionEvent event) {
OptionMapping optionMapping = event.getOption("user");
if (optionMapping == null)
throw new CommandException(getUsage());
event.replyEmbeds(execute(String.format("%s stepped at %s", event.getUser().getAsMention(), optionMapping.getAsUser().getAsMention()))).queue();
}
use of uwu.narumi.tama.command.CommandException in project TamaBot by Loli-Cafe.
the class LevelingCommand method compose.
/*
TODO: Make better handling for this type of commands
*/
@Override
public void compose(MessageReceivedEvent event, String... args) {
checkContext(event.getMember(), event.getTextChannel());
Tama.INSTANCE.getGuildManager().findGuild(Objects.requireNonNull(event.getGuild()).getId()).thenAccept(guild -> {
if (guild == null)
handleException(event, new CommandException("Can't fetch guild"));
if (args.length > 0) {
TextChannel textChannel;
if (!event.getMessage().getMentionedChannels().isEmpty())
textChannel = event.getMessage().getMentionedChannels().get(0);
else
textChannel = event.getTextChannel();
if (guild.getBlacklistedLevelingChannels().contains(textChannel.getId())) {
guild.getBlacklistedLevelingChannels().remove(textChannel.getId());
event.getTextChannel().sendMessageEmbeds(EmbedHelper.success(String.format("Leveling on %s is now %s", textChannel.getAsMention(), "enabled"))).queue();
} else {
guild.getBlacklistedLevelingChannels().add(textChannel.getId());
event.getTextChannel().sendMessageEmbeds(EmbedHelper.success(String.format("Leveling on %s is now %s", textChannel.getAsMention(), "disabled"))).queue();
}
} else {
guild.setLeveling(!guild.isLeveling());
event.getTextChannel().sendMessageEmbeds(EmbedHelper.success("Leveling on this server was: " + (guild.isLeveling() ? "enabled" : "disabled"))).queue();
}
});
}
Aggregations