* Backported OAuth2Application 201ecd25a2

* Backported retry on 500 57b6980313

* Backported b8034525e3 and fa5c4efa2b
This commit is contained in:
SpaceEEC
2017-08-21 22:25:21 +02:00
committed by Crawl
parent be4ccb3686
commit f7664b01a2
14 changed files with 304 additions and 5 deletions

View File

@@ -3,6 +3,7 @@ const Role = require('./Role');
const PermissionOverwrites = require('./PermissionOverwrites');
const Permissions = require('../util/Permissions');
const Collection = require('../util/Collection');
const Constants = require('../util/Constants');
/**
* Represents a guild channel (i.e. text channels and voice channels).
@@ -328,6 +329,36 @@ class GuildChannel extends Channel {
this.permissionsFor(this.client.user).has(Permissions.FLAGS.MANAGE_CHANNELS);
}
/**
* Whether the channel is muted
* <warn>This is only available when using a user account.</warn>
* @type {?boolean}
* @readonly
*/
get muted() {
if (this.client.user.bot) return null;
try {
return this.client.user.guildSettings.get(this.guild.id).channelOverrides.get(this.id).muted;
} catch (err) {
return false;
}
}
/**
* The type of message that should notify you
* <warn>This is only available when using a user account.</warn>
* @type {?MessageNotificationType}
* @readonly
*/
get messageNotifications() {
if (this.client.user.bot) return null;
try {
return this.client.user.guildSettings.get(this.guild.id).channelOverrides.get(this.id).messageNotifications;
} catch (err) {
return Constants.MessageNotificationTypes[3];
}
}
/**
* When concatenated with a string, this automatically returns the channel's mention instead of the Channel object.
* @returns {string}