Skip to content

TextChannel

Package: @erinjs/core

Constructor

NameTypeOptionalDescription
clientClientNo
dataAPIChannelNo

Properties

NameTypeReadonlyOptionalDescription
lastMessageIdstring | nullNoYes
messagesMessageManagerYesNoMessage manager for this channel. Use channel.messages.fetch(messageId).
nsfwbooleanNoYes
rateLimitPerUsernumberNoYes
topicstring | nullNoYes

Methods

createMessageCollector()

Create a message collector for this channel. Collects messages matching the filter until time expires or max is reached.

Returns: MessageCollector

Parameters:

NameTypeOptionalDescription
optionsMessageCollectorOptionsYesFilter, time (ms), and max count

fetchMessage() async

Fetch a message by ID from this channel.

Returns: Promise<Message>

Parameters:

NameTypeOptionalDescription
messageIdstringNoSnowflake of the message

fetchPinnedMessages() async

Fetch pinned messages in this channel.

Returns: Promise<Message[]>

Parameters:

None


send() async

Send a message to this channel.

Returns: Promise<Message>

Parameters:

NameTypeOptionalDescription
optionsMessageSendOptionsNoText content or object with content, embeds, and/or files

Released under the Apache-2.0 License.