mirror of
https://github.com/discordjs/discord.js.git
synced 2026-06-03 17:40:07 +00:00
Backport news/store channels
This commit is contained in:
@@ -20,6 +20,8 @@ class Channel {
|
||||
* * `text` - a guild text channel
|
||||
* * `voice` - a guild voice channel
|
||||
* * `category` - a guild category channel
|
||||
* * `news` - a guild news channel
|
||||
* * `store` - a guild store channel
|
||||
* @type {string}
|
||||
*/
|
||||
this.type = null;
|
||||
|
||||
24
src/structures/NewsChannel.js
Normal file
24
src/structures/NewsChannel.js
Normal file
@@ -0,0 +1,24 @@
|
||||
const TextChannel = require('./TextChannel');
|
||||
|
||||
/**
|
||||
* Represents a guild news channel on Discord.
|
||||
* @extends {TextChannel}
|
||||
*/
|
||||
class NewsChannel extends TextChannel {
|
||||
constructor(guild, data) {
|
||||
super(guild, data);
|
||||
this.type = 'news';
|
||||
}
|
||||
|
||||
setup(data) {
|
||||
super.setup(data);
|
||||
|
||||
/**
|
||||
* The ratelimit per user for this channel (always 0)
|
||||
* @type {number}
|
||||
*/
|
||||
this.rateLimitPerUser = 0;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = NewsChannel;
|
||||
25
src/structures/StoreChannel.js
Normal file
25
src/structures/StoreChannel.js
Normal file
@@ -0,0 +1,25 @@
|
||||
const GuildChannel = require('./GuildChannel');
|
||||
|
||||
/**
|
||||
* Represents a guild store channel on Discord.
|
||||
* @extends {GuildChannel}
|
||||
*/
|
||||
class StoreChannel extends GuildChannel {
|
||||
constructor(guild, data) {
|
||||
super(guild, data);
|
||||
this.type = 'store';
|
||||
}
|
||||
|
||||
setup(data) {
|
||||
super.setup(data);
|
||||
|
||||
/**
|
||||
* If the guild considers this channel NSFW
|
||||
* @type {boolean}
|
||||
* @readonly
|
||||
*/
|
||||
this.nsfw = data.nsfw;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = StoreChannel;
|
||||
Reference in New Issue
Block a user