Skip to content

Channel API

Note

The following classes come from the scurrypy.parts.channel module.


GuildChannel dataclass

Bases: DataModel

Parameters for creating/editing a guild channel.

name: Optional[str] = None class-attribute instance-attribute

Name of the channel.

type: Optional[int] = None class-attribute instance-attribute

Type of channel. See ChannelTypes.

topic: Optional[str] = None class-attribute instance-attribute

Topic of channel.

position: Optional[int] = None class-attribute instance-attribute

Sorting position of the channel (channels with the same position are sorted by id).

parent_id: Optional[int] = None class-attribute instance-attribute

ID of the parent category for a channel.

nsfw: Optional[bool] = None class-attribute instance-attribute

Whether the channel is NSFW.

to_dict

Recursively turns the dataclass into a dictionary and drops empty fields.

Returns:

  • dict

    serialized dataclasss


ChannelTypes

Constants for channel types.

Note

Only supported Channel Types listed here

GUILD_TEXT = 0 class-attribute instance-attribute

Text channel within a server.

GUILD_CATEGORY = 4 class-attribute instance-attribute

Organizational category that contains up to 50 channels.

GUILD_ANNOUNCEMENT = 5 class-attribute instance-attribute

Channel that users can follow and crosspost into their own server (formerly news channels).