MessageChannel class

Provides abstraction of messages for CachelessTextChannel, DMChannel and GroupDMChannel. Implements iterator which allows to use message object in for loops to access messages sequentially.

var chan = client.channels.firstWhere((ch) => ch is TextChannel);

for (var message in chan) {
  print(message.author.id);
}
Implemented types
Implementers

Constructors

MessageChannel()

Properties

client Nyxx
Reference to client
read-only, override
createdAt DateTime
Gets creation timestamp included in Snowflake
read-only, inherited
fileUploadLimit int
File upload limit for channel in bytes. If channel is CachelessGuildChannel returns default value.
read-only
hashCode int
The hash code for this object. [...]
read-only, inherited
id Snowflake
ID of entity as Snowflake
final, inherited
iterator Iterator<Message>
Returns iterator for messages cache
read-only
messages MessageCache
A collection of messages sent to this channel.
final, late
onMessage Stream<MessageReceivedEvent>
Sent when a new message is received.
final, late
onTyping Stream<TypingEvent>
Emitted when user starts typing.
final, late
pinsUpdated Stream<ChannelPinsUpdateEvent>
Emitted when channel pins are updated.
final, late
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
type ChannelType
The channel's type. https://discordapp.com/developers/docs/resources/channel#channel-object-channel-types
final, inherited

Methods

bulkRemoveMessages(Iterable<Message> messagesIds) Future<void>
Bulk removes many messages by its ids. messagesIds is list of messages ids to delete. [...]
delete({String auditReason}) Future<void>
Deletes the channel. Throws if bot cannot perform operation
inherited
dispose() Future<void>
Perform cleanup
override
getMessage(Snowflake id, {bool ignoreCache: false}) Future<Message>
Returns message with given id. Allows to force fetch message from api with ignoreCache property. By default it checks if message is in cache and fetches from api if not.
getMessages({int limit: 50, Snowflake after, Snowflake before, Snowflake around}) Stream<Message>
Gets several Message objects from API. Only one of after, before, around can be specified, otherwise, it will throw. [...]
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
send({dynamic content, List<AttachmentBuilder> files, EmbedBuilder embed, bool tts, AllowedMentions allowedMentions, MessageBuilder builder}) Future<Message>
Sends message to channel. Performs toString() on thing passed to content. Allows to send embeds with embed field. [...]
override
startTyping() Future<void>
Starts typing.
startTypingLoop() → void
Loops startTyping until stopTypingLoop is called.
stopTypingLoop() → void
Stops a typing loop if one is running.
toString() String
Returns a string representation of this object.
inherited

Operators

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