WelcomeChannel.js
1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
'use strict';
const Base = require('./Base');
const { Emoji } = require('./Emoji');
/**
* Represents a channel link in a guild's welcome screen.
* @extends {Base}
*/
class WelcomeChannel extends Base {
constructor(guild, data) {
super(guild.client);
/**
* The guild for this welcome channel
* @type {Guild|InviteGuild}
*/
this.guild = guild;
/**
* The description of this welcome channel
* @type {string}
*/
this.description = data.description;
/**
* The raw emoji data
* @type {Object}
* @private
*/
this._emoji = {
name: data.emoji_name,
id: data.emoji_id,
};
/**
* The id of this welcome channel
* @type {Snowflake}
*/
this.channelId = data.channel_id;
}
/**
* The channel of this welcome channel
* @type {?(TextChannel|NewsChannel|StoreChannel)}
*/
get channel() {
return this.client.channels.resolve(this.channelId);
}
/**
* The emoji of this welcome channel
* @type {GuildEmoji|Emoji}
*/
get emoji() {
return this.client.emojis.resolve(this._emoji.id) ?? new Emoji(this.client, this._emoji);
}
}
module.exports = WelcomeChannel;