public class CommandEvent
extends net.dv8tion.jda.core.events.message.guild.GuildMessageReceivedEvent
GuildMessageReceivedEvent| Modifier and Type | Class | Description |
|---|---|---|
static class |
CommandEvent.Command |
Describes an executed Command.
|
| Constructor | Description |
|---|---|
CommandEvent(net.dv8tion.jda.core.JDA api,
long responseNumber,
net.dv8tion.jda.core.entities.Message message,
CommandEvent.Command command,
CommandSettings settings) |
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
checkBotPermissions(net.dv8tion.jda.core.Permission... permissions) |
Returns whether the self member has the given permissions in the event channel.
|
boolean |
checkMemberPermissions(net.dv8tion.jda.core.Permission... permissions) |
Returns whether the Member who executed the command has the given permissions in the event channel.
|
String[] |
getArgs() |
Returns the arguments of the command.
|
CommandEvent.Command |
getCommand() |
|
CommandSettings |
getCommandSettings() |
Returns the CommandSettings instance this command was called for.
|
Optional<net.dv8tion.jda.core.entities.TextChannel> |
getFirstChannelMention() |
Returns the first channel mention in the event message as an Optional.
|
Optional<? extends net.dv8tion.jda.core.entities.IMentionable> |
getFirstMention(net.dv8tion.jda.core.entities.Message.MentionType... mentionTypes) |
Returns the first mention in the event message as an Optional.
|
Optional<net.dv8tion.jda.core.entities.Role> |
getFirstRoleMention() |
Returns the first role mention in the event message as an Optional.
|
Optional<net.dv8tion.jda.core.entities.User> |
getFirstUserMention() |
Returns the first member mention in the event message as an Optional.
|
protected static CommandEvent.Command |
parseCommand(String raw,
String prefix,
CommandSettings settings) |
|
void |
respond(String msg) |
Sends a message to the event channel.
|
void |
respond(net.dv8tion.jda.core.entities.Message msg) |
Sends a message to the event channel.
|
void |
respond(net.dv8tion.jda.core.entities.MessageEmbed msg) |
Sends a message to the event channel.
|
getChannel, getMessageId, getMessageIdLongpublic CommandEvent(net.dv8tion.jda.core.JDA api,
long responseNumber,
net.dv8tion.jda.core.entities.Message message,
CommandEvent.Command command,
CommandSettings settings)
public void respond(String msg)
msg - The message to respond with as a String.public void respond(net.dv8tion.jda.core.entities.MessageEmbed msg)
msg - The message to respond with as a MessageEmbed.public void respond(net.dv8tion.jda.core.entities.Message msg)
msg - The message to respond with as a Message object.public CommandEvent.Command getCommand()
public CommandSettings getCommandSettings()
CommandSettingspublic String[] getArgs()
public Optional<? extends net.dv8tion.jda.core.entities.IMentionable> getFirstMention(net.dv8tion.jda.core.entities.Message.MentionType... mentionTypes)
mentionTypes - The MentionTypes to look for.Optionalpublic Optional<net.dv8tion.jda.core.entities.User> getFirstUserMention()
Optionalpublic Optional<net.dv8tion.jda.core.entities.Role> getFirstRoleMention()
Optionalpublic Optional<net.dv8tion.jda.core.entities.TextChannel> getFirstChannelMention()
Optionalpublic boolean checkMemberPermissions(net.dv8tion.jda.core.Permission... permissions)
permissions - One or more Checks to check for.public boolean checkBotPermissions(net.dv8tion.jda.core.Permission... permissions)
permissions - One or more Checks to check for.protected static CommandEvent.Command parseCommand(String raw, String prefix, CommandSettings settings)
Copyright © 2018. All rights reserved.