BaseChannel class
Last updated
Last updated
The BaseChannel class provides two required arguments. The first is a Discord.js channel which is either an instance of the BaseChannel class or a class which extends the Discord.js BaseChannel class. The second argument is the addon where to create the channel for and has to be an instance of the Addon class.
The id of the channel and is a Twitter snowflake.
A string which provides the type of the channel. In the table below is mentioned which types are available:
Type | Description |
---|---|
An instance of the default Date class which defines the time when the channel was created.
A number which represents the timestamp of when the channel was created.
Returns the channel mention as a string.
The url of the channel.
Returns a boolean which defines whether the channel is a text channel or not (GuildText
or GuildAnnouncement
).
Returns a boolean which defines whether the channel is a voice channel or not (GuildVoice
).
Returns a boolean which defines whether the channel is a voice stage channel or not (GuildVoiceStage
)
Returns a boolean which defines whether the channel is a DM channel or not (DM
).
Returns a boolean which defines whether the channel is a thread channel or no t(PublicThread
, PrivateThread
, AnnouncementThread
).
Returns a boolean which defines whether the channel is an open ticket of a user or not.
Returns a Member class of the member who opened the ticket. If the channel is not a ticket, the function will return undefined
.
Returns an object with information of the open ticket. If the channel is not a ticket, the function will return undefined
.
GuildText
A default Discord text channel where everyone with a certain permission is allowed to communicate with each other.
DM
A Discord DM channel which only communicates between the bot and a specific user.
GuildVoice
A default Discord voice channel where everyone with a certain permission can call with each other.
GroupDM
A Discord DM channel which communicates with a specific set of people. This is not supported for bots.
GuildCategory
A category channel where channels can be organized in.
GuildAnnouncement
An announcement text channel in which server announcements are sent and users can follow and crosspost into their own guild.
AnnouncementThread
A Discord thread channel which only can be created in announcement channels.
PublicThread
A Discord thread channel where everyone who has access to the parent channel can communicate in.
PrivateThread
A Discord thread channel where only a specific set of people has access to unlike the PublicThread channel.
GuildStageVoice
A Discord voice channel where only a specific set of people can talk and the other participants can only listen to what's being told by the hosters.
GuildDirectory
A channel in a Student Hub which contains a list of servers.
GuildForum
A Discord channel where posts can be created and only can be communicated in the posts.