CommandContext class

Helper class which describes context in which command is executed

Properties

author → IMessageAuthor
Author of message
final
channel → MessageChannel
Channel from where message come from
final
client → Nyxx
Reference to client
read-only
commandMatcher String
Substring by which command was matched
final
guild → Guild
Guild in which message was sent
final
hashCode int
The hash code for this object. [...]
read-only, inherited
member → IMember
Returns author as guild member
read-only
message → Message
Message that was sent
final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
shardId int
Shard on which message was sent
read-only

Methods

awaitEmoji(Message msg) Future<Emoji>
Awaits for emoji under given msg
awaitEmojis(Message msg, Duration duration) Future<Map<Emoji, int>>
Collects emojis within given duration. Returns empty map if no reaction received [...]
enterTypingState<T>(Future<T> callback()) Future<T>
Starts typing loop and ends when callback resolves.
getArguments() Iterable<String>
Returns list of words separated with space and/or text surrounded by quotes Text: hi this is "example stuff" which 'can be parsed' will return List<String> [hi, this, is, example stuff, which, can be parsed]
getCodeBlocks() Iterable<String>
Returns list of all code blocks in message Language string dart, java will be ignored and not included """ n> eval ```(dart)? await reply(content: 'no to elo'); [...]
getQuotedText() Iterable<String>
Returns list which content of quotes. Text: hi this is "example stuff" which 'can be parsed' will return List<String> [example stuff, can be parsed]
nextMessages(int num) Stream<MessageReceivedEvent>
Gets next num number of any messages sent within one context (same channel). [...]
nextMessagesWhere(bool predicate(MessageReceivedEvent msg), {int limit: 100}) Stream<MessageReceivedEvent>
Gets all context channel messages that satisfies predicate. [...]
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
reply({dynamic content, List<AttachmentBuilder> files, EmbedBuilder embed, bool tts, AllowedMentions allowedMentions, MessageBuilder builder}) Future<Message>
Reply to message. It allows to send regular message, Embed or both. [...]
replyDelayed(Duration duration, {dynamic content, List<AttachmentBuilder> files, EmbedBuilder embed, bool tts, AllowedMentions allowedMentions, MessageBuilder builder}) Future<Message>
Replies to message after delay specified with duration [...]
replyTemp(Duration duration, {dynamic content, List<AttachmentBuilder> files, EmbedBuilder embed, bool tts, AllowedMentions allowedMentions, MessageBuilder builder}) Future<Message>
Reply to messages, then delete it when duration expires. [...]
toString() String
Returns a string representation of this object.
inherited
waitForTyping(User user, {Duration timeout: const Duration(seconds: 30)}) Future<TypingEvent>
Waits for first TypingEvent and returns it. If timed out returns null. Can listen to specific user by specifying user

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited