use of net.dv8tion.jda.api.interactions.commands.OptionMapping in project TamaBot by Loli-Cafe.
the class DestroyCommand 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 destroyed %s", event.getUser().getAsMention(), optionMapping.getAsUser().getAsMention()))).queue();
}
use of net.dv8tion.jda.api.interactions.commands.OptionMapping in project TamaBot by Loli-Cafe.
the class DobulePenetrationCommand 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 was double penetrated by %s", event.getUser().getAsMention(), optionMapping.getAsUser().getAsMention()))).queue();
}
use of net.dv8tion.jda.api.interactions.commands.OptionMapping in project TamaBot by Loli-Cafe.
the class EarFuckCommand 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 ear fucked %s", event.getUser().getAsMention(), optionMapping.getAsUser().getAsMention()))).queue();
}
use of net.dv8tion.jda.api.interactions.commands.OptionMapping in project TamaBot by Loli-Cafe.
the class ElectroTortureCommand 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 tortures %s with electricity", event.getUser().getAsMention(), optionMapping.getAsUser().getAsMention()))).queue();
}
use of net.dv8tion.jda.api.interactions.commands.OptionMapping in project TamaBot by Loli-Cafe.
the class ProxyCommand method compose.
@Override
public void compose(SlashCommandInteractionEvent event) {
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"));
OptionMapping optionMapping = event.getOption("channel");
if (optionMapping != null) {
TextChannel textChannel = optionMapping.getAsTextChannel();
if (!guild.getWhitelistedProxyChannels().contains(textChannel.getId())) {
guild.getWhitelistedProxyChannels().remove(textChannel.getId());
event.replyEmbeds(EmbedHelper.success(String.format("Proxy on %s is now %s", textChannel.getAsMention(), "enabled"))).queue();
} else {
guild.getWhitelistedProxyChannels().add(textChannel.getId());
event.replyEmbeds(EmbedHelper.success(String.format("Proxy on %s is now %s", textChannel.getAsMention(), "disabled"))).queue();
}
} else {
guild.setProxy(!guild.isProxy());
event.replyEmbeds(EmbedHelper.success("Proxy on this server was: " + (guild.isProxy() ? "enabled" : "disabled"))).queue();
}
});
}
Aggregations