mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 17:13:31 +01:00
Add user_guild_settings support (#1365)
* user guild settings
* Use direct collection
* I'm a goof
* double goof
* Structure properties
* Forgot to register listener
* wrong class names
* No more get in docs
* avoid waterfalls, bot checks
* trycatch
wow i thought i already did this :notlikecat:
* 👀
* Update ClientUser.js
* Update ClientUserGuildSettings.js
* Update UserGuildSettingsUpdate.js
* Update ClientUserChannelOverride.js
* Update ClientUserGuildSettings.js
This commit is contained in:
@@ -231,6 +231,7 @@ exports.Events = {
|
||||
USER_UPDATE: 'userUpdate',
|
||||
USER_NOTE_UPDATE: 'userNoteUpdate',
|
||||
USER_SETTINGS_UPDATE: 'clientUserSettingsUpdate',
|
||||
USER_GUILD_SETTINGS_UPDATE: 'clientUserGuildSettingsUpdate',
|
||||
PRESENCE_UPDATE: 'presenceUpdate',
|
||||
VOICE_STATE_UPDATE: 'voiceStateUpdate',
|
||||
TYPING_START: 'typingStart',
|
||||
@@ -312,6 +313,7 @@ exports.WSEvents = {
|
||||
USER_UPDATE: 'USER_UPDATE',
|
||||
USER_NOTE_UPDATE: 'USER_NOTE_UPDATE',
|
||||
USER_SETTINGS_UPDATE: 'USER_SETTINGS_UPDATE',
|
||||
USER_GUILD_SETTINGS_UPDATE: 'USER_GUILD_SETTINGS_UPDATE',
|
||||
PRESENCE_UPDATE: 'PRESENCE_UPDATE',
|
||||
VOICE_STATE_UPDATE: 'VOICE_STATE_UPDATE',
|
||||
TYPING_START: 'TYPING_START',
|
||||
@@ -349,6 +351,13 @@ exports.ExplicitContentFilterTypes = [
|
||||
'FRIENDS_AND_NON_FRIENDS',
|
||||
];
|
||||
|
||||
exports.MessageNotificationTypes = [
|
||||
'EVERYTHING',
|
||||
'MENTIONS',
|
||||
'NOTHING',
|
||||
'INHERIT',
|
||||
];
|
||||
|
||||
exports.UserSettingsMap = {
|
||||
/**
|
||||
* Automatically convert emoticons in your messages to emoji
|
||||
@@ -482,6 +491,60 @@ exports.UserSettingsMap = {
|
||||
},
|
||||
};
|
||||
|
||||
exports.UserGuildSettingsMap = {
|
||||
message_notifications: function messageNotifications(type) { // eslint-disable-line func-name-matching
|
||||
/**
|
||||
* The type of message that should notify you
|
||||
* one of `EVERYTHING`, `MENTIONS`, `NOTHING`
|
||||
* @name ClientUserGuildSettings#messageNotifications
|
||||
* @type {string}
|
||||
*/
|
||||
return exports.MessageNotificationTypes[type];
|
||||
},
|
||||
/**
|
||||
* Whether to receive mobile push notifications
|
||||
* @name ClientUserGuildSettings#mobilePush
|
||||
* @type {boolean}
|
||||
*/
|
||||
mobile_push: 'mobilePush',
|
||||
/**
|
||||
* Whether the guild is muted or not
|
||||
* @name ClientUserGuildSettings#muted
|
||||
* @type {boolean}
|
||||
*/
|
||||
muted: 'muted',
|
||||
/**
|
||||
* Whether to suppress everyone messages
|
||||
* @name ClientUserGuildSettings#suppressEveryone
|
||||
* @type {boolean}
|
||||
*/
|
||||
suppress_everyone: 'suppressEveryone',
|
||||
/**
|
||||
* A collection containing all the channel overrides
|
||||
* @name ClientUserGuildSettings#channelOverrides
|
||||
* @type {Collection<ClientUserChannelOverride>}
|
||||
*/
|
||||
channel_overrides: 'channelOverrides',
|
||||
};
|
||||
|
||||
exports.UserChannelOverrideMap = {
|
||||
message_notifications: function messageNotifications(type) { // eslint-disable-line func-name-matching
|
||||
/**
|
||||
* The type of message that should notify you
|
||||
* one of `EVERYTHING`, `MENTIONS`, `NOTHING`, `INHERIT`
|
||||
* @name ClientUserChannelOverrides#messageNotifications
|
||||
* @type {string}
|
||||
*/
|
||||
return exports.MessageNotificationTypes[type];
|
||||
},
|
||||
/**
|
||||
* Whether the guild is muted or not
|
||||
* @name ClientUserChannelOverrides#muted
|
||||
* @type {boolean}
|
||||
*/
|
||||
muted: 'muted',
|
||||
};
|
||||
|
||||
/**
|
||||
* All flags users can have:
|
||||
* - STAFF
|
||||
|
||||
Reference in New Issue
Block a user