mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 08:33:30 +01:00
Merge branch 'master' into voice-rewrite
This commit is contained in:
@@ -3,7 +3,7 @@ const Channel = require('../structures/Channel');
|
||||
const { ChannelTypes } = require('../util/Constants');
|
||||
const DataStore = require('./DataStore');
|
||||
const GuildChannel = require('../structures/GuildChannel');
|
||||
const { resolve } = require('../util/Permissions');
|
||||
const Permissions = require('../util/Permissions');
|
||||
|
||||
/**
|
||||
* Stores guild channels.
|
||||
@@ -54,8 +54,8 @@ class GuildChannelStore extends DataStore {
|
||||
overwrites = overwrites.map(overwrite => {
|
||||
let allow = overwrite.allow || (overwrite.allowed ? overwrite.allowed.bitfield : 0);
|
||||
let deny = overwrite.deny || (overwrite.denied ? overwrite.denied.bitfield : 0);
|
||||
if (allow instanceof Array) allow = resolve(allow);
|
||||
if (deny instanceof Array) deny = resolve(deny);
|
||||
if (allow instanceof Array) allow = Permissions.resolve(allow);
|
||||
if (deny instanceof Array) deny = Permissions.resolve(deny);
|
||||
|
||||
const role = this.guild.roles.resolve(overwrite.id);
|
||||
if (role) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
const DataStore = require('./DataStore');
|
||||
const Role = require('../structures/Role');
|
||||
const { resolveColor } = require('../util/Util');
|
||||
const { resolve } = require('../util/Permissions');
|
||||
const Permissions = require('../util/Permissions');
|
||||
|
||||
/**
|
||||
* Stores roles.
|
||||
@@ -42,7 +42,7 @@ class RoleStore extends DataStore {
|
||||
*/
|
||||
create(data = {}, reason) {
|
||||
if (data.color) data.color = resolveColor(data.color);
|
||||
if (data.permissions) data.permissions = resolve(data.permissions);
|
||||
if (data.permissions) data.permissions = Permissions.resolve(data.permissions);
|
||||
|
||||
return this.guild.client.api.guilds(this.guild.id).roles.post({ data, reason }).then(r => {
|
||||
const { role } = this.client.actions.GuildRoleCreate.handle({
|
||||
|
||||
@@ -657,7 +657,7 @@ exports.Colors = {
|
||||
* * CANNOT_PIN_MESSAGE_IN_OTHER_CHANNEL
|
||||
* * CANNOT_EXECUTE_ON_SYSTEM_MESSAGE
|
||||
* * BULK_DELETE_MESSAGE_TOO_OLD
|
||||
* * INVITE_ACCEPTED_TO_GUILD_NOT_CONTANING_BOT
|
||||
* * INVITE_ACCEPTED_TO_GUILD_NOT_CONTAINING_BOT
|
||||
* * REACTION_BLOCKED
|
||||
* @typedef {string} APIError
|
||||
*/
|
||||
@@ -703,7 +703,7 @@ exports.APIErrors = {
|
||||
CANNOT_PIN_MESSAGE_IN_OTHER_CHANNEL: 50019,
|
||||
CANNOT_EXECUTE_ON_SYSTEM_MESSAGE: 50021,
|
||||
BULK_DELETE_MESSAGE_TOO_OLD: 50034,
|
||||
INVITE_ACCEPTED_TO_GUILD_NOT_CONTANING_BOT: 50036,
|
||||
INVITE_ACCEPTED_TO_GUILD_NOT_CONTAINING_BOT: 50036,
|
||||
REACTION_BLOCKED: 90001,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user