Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,16 @@ declare namespace Eris {
computePruneCount?: boolean;
reason?: string;
}
interface WelcomeChannel {
channelID: string;
description: string;
emojiID: string | null;
emojiName: string | null;
}
interface WelcomeScreen {
description: string;
welcomeChannels: WelcomeChannel[];
}
interface VoiceRegion {
custom: boolean;
deprecated: boolean;
Expand Down Expand Up @@ -1171,7 +1181,6 @@ declare namespace Eris {
theme: string;
}


class Base implements SimpleJSON {
createdAt: number;
id: string;
Expand Down Expand Up @@ -1775,8 +1784,10 @@ declare namespace Eris {
vanityURL: string | null;
verificationLevel: number;
voiceStates: Collection<VoiceState>;
welcomeScreen?: WelcomeScreen;
widgetChannelID?: string | null;
widgetEnabled?: boolean | null;

constructor(data: BaseData, client: Client);
addDiscoverySubcategory(categoryID: string, reason?: string): Promise<DiscoverySubcategoryResponse>;
addMemberRole(memberID: string, roleID: string, reason?: string): Promise<void>;
Expand Down
16 changes: 16 additions & 0 deletions lib/structures/Guild.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ const {Permissions} = require("../Constants");
* @prop {String?} vanityURL The vanity URL of the guild (VIP only)
* @prop {Number} verificationLevel The guild verification level
* @prop {Collection<VoiceState>} voiceStates Collection of voice states in the guild
* @prop {Object?} welcomeScreen The welcome screen of a Community guild, shown to new members
* @prop {Object} welcomeScreen.description The description in the welcome screen
* @prop {Array<Object>} welcomeScreen.welcomeChannels The list of channels in the welcome screens. Each channels have the following properties: `channelID`, `description`, `emojiID`, `emojiName`. `emojiID` and `emojiName` properties can be null.
* @prop {Number?} widgetChannelID The channel id that the widget will generate an invite to. REST only.
* @prop {Boolean?} widgetEnabled Whether the guild widget is enabled. REST only.
*/
Expand Down Expand Up @@ -261,6 +264,19 @@ class Guild extends Base {
if(data.max_video_channel_users !== undefined) {
this.maxVideoChannelUsers = data.max_video_channel_users;
}
if(data.guild.welcome_screen !== undefined) {
this.welcomeScreen = {
description: data.guild.welcome_screen.description,
welcomeChannels: data.guild.welcome_screen.welcome_channels && data.guild.welcome_screen.welcome_channels.map((c) => {
return {
channelID: c.channel,
description: c.description,
emojiID: c.emoji_id,
emojiName: c.emoji_name
};
})
};
}
}

get bannerURL() {
Expand Down