Skip to main content
Channel is the representation of a channel in the client cache. Covers text, voice, category, and DM channels.

Fields


ChannelType


Constructors

Channel::from_api

Creates a Channel from an API response.

Channel::from_id

Creates an empty stub by ID. All fields except id take default values.

Methods

Type checks


Helpers

display_name

Returns name if set, otherwise "unknown".

mention

Returns the channel mention string in the format <#id>.

as_typed

Returns a TypedChannel - a typed representation of the channel based on its kind. Use for pattern matching on a specific channel type.

Messages

send

Sends a message to the channel.

send_files

Sends a message with files via multipart/form-data. See Files for details on FileAttachment.

fetch_message

Fetches a message by ID.

fetch_messages

Returns the message history of the channel.

send_typing

Sends the “typing…” indicator. The effect lasts ~10 seconds or until a message is sent.

bulk_delete_messages

Bulk deletes messages. Accepts a list of message IDs.
Fluxer may have restrictions on bulk deletion based on message age. Check the current API limits.

Pinned messages

pin_message / unpin_message

Pins or unpins a message in the channel.

fetch_pinned_messages

Returns the list of pinned messages.

Invites

create_invite

Creates an invite for the channel.

fetch_invites

Returns the list of channel invites.

Webhooks

create_webhook

Creates a webhook in the channel. avatar is a data URI image.

fetch_webhooks

Returns the list of channel webhooks.

Permissions

edit_permission

Creates or updates a permission overwrite for a role or user. Request body:

delete_permission

Deletes a permission overwrite.

Edit and delete

edit

Updates channel settings. Pass only the fields you want to change.

delete

Deletes the channel.

Group DM

add_recipient / remove_recipient

Adds or removes a user from a group DM channel (kind == 3).