use of uwu.narumi.tama.command.CommandException in project TamaBot by Loli-Cafe.
the class NotificationsCommand 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"));
TextChannel textChannel;
if (!event.getMessage().getMentionedChannels().isEmpty())
textChannel = event.getMessage().getMentionedChannels().get(0);
else
textChannel = event.getTextChannel();
event.getTextChannel().sendMessageEmbeds(EmbedHelper.success(String.format("%s is now notification channel", textChannel.getAsMention()))).queue();
guild.setNotificationChannel(textChannel.getId());
});
}
use of uwu.narumi.tama.command.CommandException in project TamaBot by Loli-Cafe.
the class RapeCommand 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 forcefully raped %s", 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 TitJobCommand 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 titjob to %s", 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 TouchPussyCommand 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 touched %s pussy", 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 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();
}
Aggregations