mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 08:33:30 +01:00
docs(BitFields): remove string from BitFieldResolvable (#5122)
* refactor(BitFields): remove string from BitFieldResolvable * docs(Client#generateInvite): fix indentation in example * chore: resolve conflict * refactor: revert breaking changes Co-authored-by: Papaia <43409674+ItsPapaia@users.noreply.github.com>
This commit is contained in:
@@ -4,6 +4,7 @@ const Integration = require('./Integration');
|
||||
const Webhook = require('./Webhook');
|
||||
const Collection = require('../util/Collection');
|
||||
const { PartialTypes } = require('../util/Constants');
|
||||
const Permissions = require('../util/Permissions');
|
||||
const Snowflake = require('../util/Snowflake');
|
||||
const Util = require('../util/Util');
|
||||
|
||||
@@ -441,7 +442,7 @@ class GuildAuditLogsEntry {
|
||||
);
|
||||
} else if (targetType === Targets.INVITE) {
|
||||
this.target = guild.members.fetch(guild.client.user.id).then(me => {
|
||||
if (me.permissions.has('MANAGE_GUILD')) {
|
||||
if (me.permissions.has(Permissions.FLAGS.MANAGE_GUILD)) {
|
||||
const change = this.changes.find(c => c.key === 'code');
|
||||
return guild.fetchInvites().then(invites => {
|
||||
this.target = invites.find(i => i.code === (change.new || change.old));
|
||||
|
||||
@@ -200,7 +200,7 @@ class GuildChannel extends Channel {
|
||||
* channel.overwritePermissions([
|
||||
* {
|
||||
* id: message.author.id,
|
||||
* deny: ['VIEW_CHANNEL'],
|
||||
* deny: [Permissions.FLAGS.VIEW_CHANNEL],
|
||||
* },
|
||||
* ], 'Needed to change permissions');
|
||||
*/
|
||||
@@ -284,7 +284,7 @@ class GuildChannel extends Channel {
|
||||
get members() {
|
||||
const members = new Collection();
|
||||
for (const member of this.guild.members.cache.values()) {
|
||||
if (this.permissionsFor(member).has('VIEW_CHANNEL', false)) {
|
||||
if (this.permissionsFor(member).has(Permissions.FLAGS.VIEW_CHANNEL, false)) {
|
||||
members.set(member.id, member);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -296,7 +296,7 @@ class Role extends Base {
|
||||
* @returns {Promise<Role>}
|
||||
* @example
|
||||
* // Set the permissions of the role
|
||||
* role.setPermissions(['KICK_MEMBERS', 'BAN_MEMBERS'])
|
||||
* role.setPermissions([Permissions.FLAGS.KICK_MEMBERS, Permissions.FLAGS.BAN_MEMBERS])
|
||||
* .then(updated => console.log(`Updated permissions to ${updated.permissions.bitfield}`))
|
||||
* .catch(console.error);
|
||||
* @example
|
||||
|
||||
Reference in New Issue
Block a user