mirror of
https://github.com/danbulant/discord.js
synced 2026-06-09 01:31:29 +00:00
feat(Guild#defaultMessageNotifications) (#2538)
* feat(Guild#defaultMessageNotifications) * boolean -> DefaultMessageNotifications * Space's requested change
This commit is contained in:
parent
f0c4d0e834
commit
30c7d6d1b1
2 changed files with 19 additions and 1 deletions
|
|
@ -2,7 +2,7 @@ const Invite = require('./Invite');
|
||||||
const GuildAuditLogs = require('./GuildAuditLogs');
|
const GuildAuditLogs = require('./GuildAuditLogs');
|
||||||
const Webhook = require('./Webhook');
|
const Webhook = require('./Webhook');
|
||||||
const VoiceRegion = require('./VoiceRegion');
|
const VoiceRegion = require('./VoiceRegion');
|
||||||
const { ChannelTypes, Events, browser } = require('../util/Constants');
|
const { ChannelTypes, DefaultMessageNotifications, Events, browser } = require('../util/Constants');
|
||||||
const Collection = require('../util/Collection');
|
const Collection = require('../util/Collection');
|
||||||
const Util = require('../util/Util');
|
const Util = require('../util/Util');
|
||||||
const DataResolver = require('../util/DataResolver');
|
const DataResolver = require('../util/DataResolver');
|
||||||
|
|
@ -188,6 +188,13 @@ class Guild extends Base {
|
||||||
*/
|
*/
|
||||||
this.joinedTimestamp = data.joined_at ? new Date(data.joined_at).getTime() : this.joinedTimestamp;
|
this.joinedTimestamp = data.joined_at ? new Date(data.joined_at).getTime() : this.joinedTimestamp;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The value set for a guild's default message notifications
|
||||||
|
* @type {DefaultMessageNotifications|number}
|
||||||
|
*/
|
||||||
|
this.defaultMessageNotifications = DefaultMessageNotifications[data.default_message_notifications] ||
|
||||||
|
data.default_message_notifications;
|
||||||
|
|
||||||
this.id = data.id;
|
this.id = data.id;
|
||||||
this.available = !data.unavailable;
|
this.available = !data.unavailable;
|
||||||
this.features = data.features || this.features || [];
|
this.features = data.features || this.features || [];
|
||||||
|
|
|
||||||
|
|
@ -725,6 +725,17 @@ exports.APIErrors = {
|
||||||
REACTION_BLOCKED: 90001,
|
REACTION_BLOCKED: 90001,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The value set for a guild's default message notifications, e.g. `ALL`. Here are the available types:
|
||||||
|
* * ALL
|
||||||
|
* * MENTIONS
|
||||||
|
* @typedef {string} DefaultMessageNotifications
|
||||||
|
*/
|
||||||
|
exports.DefaultMessageNotifications = [
|
||||||
|
'ALL',
|
||||||
|
'MENTIONS',
|
||||||
|
];
|
||||||
|
|
||||||
function keyMirror(arr) {
|
function keyMirror(arr) {
|
||||||
let tmp = Object.create(null);
|
let tmp = Object.create(null);
|
||||||
for (const value of arr) tmp[value] = value;
|
for (const value of arr) tmp[value] = value;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue