Skip to content

Commit

Permalink
feat(Guild): add support to edit defaultMessageNotifications level (#…
Browse files Browse the repository at this point in the history
…2592)

* Added support for `defaultMessageNotifications`

* Requested changes

* docs: Change type for GuildEditData.defaultMessageNotifications
  • Loading branch information
kyranet authored and SpaceEEC committed Jun 19, 2018
1 parent 5e011db commit 270a278
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/structures/Guild.js
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,7 @@ class Guild extends Base {
* @property {Base64Resolvable} [icon] The icon of the guild
* @property {GuildMemberResolvable} [owner] The owner of the guild
* @property {Base64Resolvable} [splash] The splash screen of the guild
* @property {DefaultMessageNotifications|number} [defaultMessageNotifications] The default message notifications
*/

/**
Expand Down Expand Up @@ -668,6 +669,11 @@ class Guild extends Base {
if (typeof data.explicitContentFilter !== 'undefined') {
_data.explicit_content_filter = Number(data.explicitContentFilter);
}
if (typeof data.defaultMessageNotifications !== 'undefined') {
_data.default_message_notifications = typeof data.defaultMessageNotifications === 'string' ?
DefaultMessageNotifications.indexOf(data.defaultMessageNotifications) :
Number(data.defaultMessageNotifications);
}
return this.client.api.guilds(this.id).patch({ data: _data, reason })
.then(newData => this.client.actions.GuildUpdate.handle(newData).updated);
}
Expand Down

0 comments on commit 270a278

Please sign in to comment.