Documentation Index
Fetch the complete documentation index at: https://docs.devimorris.tech/llms.txt
Use this file to discover all available pages before exploring further.
Channel is the representation of a channel in the client cache. Covers text, voice, category, and DM channels.
Fields
| Field | Type | Description |
|---|---|---|
id | Snowflake | Unique channel identifier. |
kind | u16 | Channel type. See ChannelType table below. |
guild_id | Option<Snowflake> | Guild ID. None for DMs and group chats. |
name | Option<String> | Channel name. |
topic | Option<String> | Channel topic. |
url | Option<String> | Channel URL (Fluxer-specific). |
icon | Option<String> | Icon hash (for group DMs). |
owner_id | Option<Snowflake> | Owner ID of a group DM. |
position | Option<i32> | Channel position in the list. |
parent_id | Option<Snowflake> | Parent category ID. |
bitrate | Option<u32> | Voice channel bitrate (bits/s). |
user_limit | Option<u32> | Voice channel user limit. 0 - no limit. |
rtc_region | Option<String> | Voice region. None - automatic selection. |
last_message_id | Option<Snowflake> | ID of the last message in the channel. |
nsfw | bool | Whether the channel is NSFW. |
rate_limit_per_user | Option<u32> | Slowmode in seconds. 0 - disabled. |
permission_overwrites | Vec<ApiChannelOverwrite> | Permission overwrites for roles and users. |
ChannelType
| Value | Type | Description |
|---|---|---|
0 | GuildText | Guild text channel. |
1 | Dm | Direct message (DM). |
2 | GuildVoice | Guild voice channel. |
3 | GroupDm | Group DM. |
4 | GuildCategory | Channel category. |
Constructors
Channel::from_api
Channel from an API response.
Channel::from_id
id take default values.
Methods
Type checks
| Method | Returns true when |
|---|---|
is_text() | kind == GuildText or kind == Dm. |
is_voice() | kind == GuildVoice. |
is_category() | kind == GuildCategory. |
is_dm() | kind == Dm. |
is_guild() | guild_id is Some. |
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
| Parameter | Description |
|---|---|
limit | Maximum number of messages (1–100). |
before | Return messages before this ID (backwards pagination). |
after | Return messages after this ID (forwards pagination). |
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
| Parameter | Description |
|---|---|
max_age | Invite lifetime in seconds. 0 - permanent. |
max_uses | Maximum number of uses. 0 - unlimited. |
temporary | If true, the member is kicked on logout unless they received a role. |
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
| Field | Type | Description |
|---|---|---|
allow | String | Bitfield string of allowed permissions. |
deny | String | Bitfield string of denied permissions. |
type | u8 | 0 - for a role, 1 - for a member. |
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).