mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 00:23:30 +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 {
|
||||
existing = await this.fetch({ guild: guildId, command: commandId });
|
||||
existingPermissions = await this.fetch({ guild: guildId, command: commandId });
|
||||
} catch (error) {
|
||||
if (error.code !== RESTJSONErrorCodes.UnknownApplicationCommandPermissions) throw error;
|
||||
}
|
||||
|
||||
const newPermissions = permissions.slice();
|
||||
for (const perm of existing) {
|
||||
if (!newPermissions.some(x => x.id === perm.id)) {
|
||||
newPermissions.push(perm);
|
||||
for (const existingPermission of existingPermissions) {
|
||||
if (!newPermissions.some(newPermission => newPermission.id === existingPermission.id)) {
|
||||
newPermissions.push(existingPermission);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user