Channel class
Channel structure
Represents a guild or DM channel within Discord.
https://discord.com/developers/docs/resources/channel#channel-object-channel-structure
- Annotations
-
- @JsonSerializable(includeIfNull: false)
Constructors
-
Channel({required String id, required ChannelType type, String? guildId, int? position, List<
PermissionOverwrite> ? permissionOverwrites, String? name, String? topic, bool? nsfw, String? lastMessageId, int? bitrate, int? userLimit, int? rateLimitPerUser, List<User> ? recipients, String? icon, String? ownerId, String? applicationId, String? parentId, DateTime? lastPinTimestamp, String? rtcRegion, VideoQualityMode? videoQualityMode, int? messageCount, int? memberCount, ThreadMetadata? threadMetadata, ThreadMember? threadMember, ThreadAutoArchiveDuration? defaultAutoArchiveDuration, List<Permission> ? permissions}) - Constructor
-
Channel.fromJson(Map<
String, dynamic> json) -
From json
factory
Properties
- applicationId → String?
-
application id of the group DM creator if it is bot-created
final
- bitrate → int?
-
the bitrate (in bits) of the voice channel
final
- defaultAutoArchiveDuration → ThreadAutoArchiveDuration?
-
default duration that the clients (not the API) will use for newly created
threads, in minutes, to automatically archive the thread after recent
activity, can be set to: 60, 1440, 4320, 10080
final
- guildId → String?
-
the id of the guild (may be missing for some channel objects received
over gateway guild dispatches)
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- icon → String?
-
icon hash
final
- id → String
-
the id of this channel
final
- lastMessageId → String?
-
the id of the last message sent in this channel (may not point to an existing or valid message)
final
- lastPinTimestamp → DateTime?
-
when the last pinned message was pinned. This may be null in events such
as GUILD_CREATE when a message is not pinned.
final
- memberCount → int?
-
an approximate count of users in a thread, stops counting at 50
final
- messageCount → int?
-
an approximate count of messages in a thread, stops counting at 50
final
- name → String?
-
the name of the channel (1-100 characters)
final
- nsfw → bool?
-
whether the channel is nsfw
final
- ownerId → String?
-
id of the creator of the group DM or thread
final
- parentId → String?
-
for guild channels: id of the parent category for a channel (each parent
category can contain up to 50 channels), for threads: id of the text
channel this thread was created
final
-
permissionOverwrites
→ List<
PermissionOverwrite> ? -
explicit permission overwrites for members and roles
final
-
permissions
→ List<
Permission> ? -
computed permissions for the invoking user in the channel, including
overwrites, only included when part of the resolved data received on a
slash command interaction
final
- position → int?
-
sorting position of the channel
final
- rateLimitPerUser → int?
-
amount of seconds a user has to wait before sending another message
(0-21600); bots, as well as users with the permission manage_messages or
manage_channel, are unaffected
final
-
recipients
→ List<
User> ? -
the recipients of the DM
final
- rtcRegion → String?
-
voice region id for the voice channel, automatic when set to null
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- threadMember → ThreadMember?
-
thread member object for the current user, if they have joined the thread,
only included on certain API endpoints
final
- threadMetadata → ThreadMetadata?
-
thread-specific fields not needed by other channels
final
- topic → String?
-
the channel topic (0-1024 characters)
final
- type → ChannelType
-
the type of channel
final
- userLimit → int?
-
the user limit of the voice channel
final
- videoQualityMode → VideoQualityMode?
-
the camera video quality mode of the voice channel, 1 when not present
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - To json
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited