use of net.dv8tion.jda.api.interactions.commands.OptionMapping in project TamaBot by Loli-Cafe.
the class TouchPussyCommand 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 touched %s pussy", event.getUser().getAsMention(), optionMapping.getAsUser().getAsMention()))).queue();
}
use of net.dv8tion.jda.api.interactions.commands.OptionMapping in project TamaBot by Loli-Cafe.
the class HelpCommand method compose.
@Override
public void compose(SlashCommandInteractionEvent event) {
OptionMapping command = event.getOption("command");
event.getUser().openPrivateChannel().complete().sendMessageEmbeds(execute(event.getUser(), command != null ? command.getAsString() : null)).complete().delete().completeAfter(30, TimeUnit.SECONDS);
event.deferReply().queue();
}
use of net.dv8tion.jda.api.interactions.commands.OptionMapping in project TamaBot by Loli-Cafe.
the class LevelCommand method compose.
@Override
public void compose(SlashCommandInteractionEvent event) {
OptionMapping optionMapping = event.getOption("user");
Tama.INSTANCE.getUserManager().findGuildUser(event.getGuild().getId(), optionMapping != null ? optionMapping.getAsUser().getId() : event.getUser().getId()).thenAccept(user -> {
event.getTextChannel().sendMessageEmbeds(EmbedHelper.levelInfo(event.getUser(), user)).queue();
});
}
use of net.dv8tion.jda.api.interactions.commands.OptionMapping in project clancy by brendonmiranda.
the class PlayResultHandler method noMatches.
/**
* Loads a "playlist" made of the search results when the attempt of loading on
* PlayCmd doesn't match. In case of fail it returns an error message.
*/
@Override
public void noMatches() {
OptionMapping option = event.getOption(MUSIC_ARG);
String args = option.getAsString();
// conditional to avoid loop
if (!ytSearch)
audioPlayerManager.loadItem("ytsearch:" + args, new PlayResultHandler(audioPlayer, guild, audioManager, event, audioPlayerManager, eventWaiter, message, true, audioQueueService));
else
event.replyEmbeds(MessageUtil.buildMessage("Sorry, I couldn't find your track. Please, rephrase and try again.")).queue();
}
use of net.dv8tion.jda.api.interactions.commands.OptionMapping in project TechDiscordBot by TechsCode-Team.
the class PruneCommand method onCommand.
@Override
public void onCommand(TextChannel channel, Member m, SlashCommandEvent e) {
String userId = e.getUser().getId();
OptionMapping amountOption = e.getOption("amount");
int amount = amountOption == null ? 100 : (int) Math.min(200, Math.max(2, amountOption.getAsLong()));
e.reply("**This will delete " + amount + " messages.**\nAre you sure?").addActionRow(Button.success(userId + ":prune:" + amount, "Yes!"), Button.danger(userId + ":delete", "Nevermind!")).queue();
}
Aggregations