Search in sources :

Example 26 with MessageEmbed

use of net.dv8tion.jda.core.entities.MessageEmbed in project MantaroBot by Mantaro.

the class AssistedCommand method onError.

default default void onError(GuildMessageReceivedEvent event) {
    MessageEmbed helpEmbed = help(event);
    if (helpEmbed == null) {
        event.getChannel().sendMessage(EmoteReference.ERROR + "There's no extended help set for this command.").queue();
        return;
    }
    event.getChannel().sendMessage(EmoteReference.ERROR + "You executed this command incorrectly, help for it will be shown below.").queue(message -> message.delete().queueAfter(5, TimeUnit.SECONDS));
    event.getChannel().sendMessage(help(event)).queue(message -> message.delete().queueAfter(30, TimeUnit.SECONDS));
}
Also used : MessageEmbed(net.dv8tion.jda.core.entities.MessageEmbed)

Aggregations

MessageEmbed (net.dv8tion.jda.core.entities.MessageEmbed)26 GuildMessageReceivedEvent (net.dv8tion.jda.core.events.message.guild.GuildMessageReceivedEvent)22 Command (net.kodehawa.mantarobot.modules.Command)22 SimpleCommand (net.kodehawa.mantarobot.modules.commands.SimpleCommand)22 EmbedBuilder (net.dv8tion.jda.core.EmbedBuilder)12 MantaroData (net.kodehawa.mantarobot.data.MantaroData)8 CommandRegistry (net.kodehawa.mantarobot.modules.CommandRegistry)8 Module (net.kodehawa.mantarobot.modules.Module)8 Category (net.kodehawa.mantarobot.modules.commands.base.Category)8 EmoteReference (net.kodehawa.mantarobot.utils.commands.EmoteReference)8 Player (net.kodehawa.mantarobot.data.entities.Player)7 Color (java.awt.Color)6 TimeUnit (java.util.concurrent.TimeUnit)5 Slf4j (lombok.extern.slf4j.Slf4j)5 Utils (net.kodehawa.mantarobot.utils.Utils)5 Collectors (java.util.stream.Collectors)4 User (net.dv8tion.jda.core.entities.User)4 RateLimiter (net.kodehawa.mantarobot.commands.currency.RateLimiter)4 TextChannelGround (net.kodehawa.mantarobot.commands.currency.TextChannelGround)4 DBGuild (net.kodehawa.mantarobot.data.entities.DBGuild)4