Channel is the representation of a channel in the client cache. Covers text, voice, category, and DM channels.
Fields
ChannelType
Constructors
Channel::from_api
Channel from an API response.
Channel::from_id
id take default values.
Methods
Type checks
Helpers
display_name
name if set, otherwise "unknown".
mention
<#id>.
as_typed
TypedChannel - a typed representation of the channel based on its kind. Use for pattern matching on a specific channel type.
Messages
send
Example
Example
send_files
FileAttachment.
fetch_message
fetch_messages
Example: last 10 messages
Example: last 10 messages
send_typing
bulk_delete_messages
Pinned messages
pin_message / unpin_message
fetch_pinned_messages
Invites
create_invite
fetch_invites
Webhooks
create_webhook
avatar is a data URI image.
fetch_webhooks
Example: create a webhook and send a message
Example: create a webhook and send a message
Permissions
edit_permission
delete_permission
Example: deny SEND_MESSAGES for a role
Example: deny SEND_MESSAGES for a role
Edit and delete
edit
delete
Group DM
add_recipient / remove_recipient
kind == 3).