mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-13 10:03:31 +01:00
refactor: change remaining variable names
This commit is contained in:
@@ -210,17 +210,17 @@ class ApplicationCommandPermissionsManager extends BaseManager {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
let existing = [];
|
let existingPermissions = [];
|
||||||
try {
|
try {
|
||||||
existing = await this.fetch({ guild: guildId, command: commandId });
|
existingPermissions = await this.fetch({ guild: guildId, command: commandId });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error.code !== RESTJSONErrorCodes.UnknownApplicationCommandPermissions) throw error;
|
if (error.code !== RESTJSONErrorCodes.UnknownApplicationCommandPermissions) throw error;
|
||||||
}
|
}
|
||||||
|
|
||||||
const newPermissions = permissions.slice();
|
const newPermissions = permissions.slice();
|
||||||
for (const perm of existing) {
|
for (const existingPermission of existingPermissions) {
|
||||||
if (!newPermissions.some(x => x.id === perm.id)) {
|
if (!newPermissions.some(newPermission => newPermission.id === existingPermission.id)) {
|
||||||
newPermissions.push(perm);
|
newPermissions.push(existingPermission);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user