summaryrefslogtreecommitdiff
path: root/node_modules/discord.js/src/structures/WelcomeScreen.js
diff options
context:
space:
mode:
authorsowgro <tpoke.ferrari@gmail.com>2023-09-02 19:12:47 -0400
committersowgro <tpoke.ferrari@gmail.com>2023-09-02 19:12:47 -0400
commite4450c8417624b71d779cb4f41692538f9165e10 (patch)
treeb70826542223ecdf8a7a259f61b0a1abb8a217d8 /node_modules/discord.js/src/structures/WelcomeScreen.js
downloadsowbot3-e4450c8417624b71d779cb4f41692538f9165e10.tar.gz
sowbot3-e4450c8417624b71d779cb4f41692538f9165e10.tar.bz2
sowbot3-e4450c8417624b71d779cb4f41692538f9165e10.zip
first commit
Diffstat (limited to 'node_modules/discord.js/src/structures/WelcomeScreen.js')
-rw-r--r--node_modules/discord.js/src/structures/WelcomeScreen.js49
1 files changed, 49 insertions, 0 deletions
diff --git a/node_modules/discord.js/src/structures/WelcomeScreen.js b/node_modules/discord.js/src/structures/WelcomeScreen.js
new file mode 100644
index 0000000..9ff79bc
--- /dev/null
+++ b/node_modules/discord.js/src/structures/WelcomeScreen.js
@@ -0,0 +1,49 @@
+'use strict';
+
+const { Collection } = require('@discordjs/collection');
+const { GuildFeature } = require('discord-api-types/v10');
+const Base = require('./Base');
+const WelcomeChannel = require('./WelcomeChannel');
+
+/**
+ * Represents a welcome screen.
+ * @extends {Base}
+ */
+class WelcomeScreen extends Base {
+ constructor(guild, data) {
+ super(guild.client);
+
+ /**
+ * The guild for this welcome screen
+ * @type {Guild}
+ */
+ this.guild = guild;
+
+ /**
+ * The description of this welcome screen
+ * @type {?string}
+ */
+ this.description = data.description ?? null;
+
+ /**
+ * Collection of welcome channels belonging to this welcome screen
+ * @type {Collection<Snowflake, WelcomeChannel>}
+ */
+ this.welcomeChannels = new Collection();
+
+ for (const channel of data.welcome_channels) {
+ const welcomeChannel = new WelcomeChannel(this.guild, channel);
+ this.welcomeChannels.set(welcomeChannel.channelId, welcomeChannel);
+ }
+ }
+
+ /**
+ * Whether the welcome screen is enabled on the guild
+ * @type {boolean}
+ */
+ get enabled() {
+ return this.guild.features.includes(GuildFeature.WelcomeScreenEnabled);
+ }
+}
+
+module.exports = WelcomeScreen;