Downgrade to v13

[vi] cảm giác đau khổ
This commit is contained in:
March 7th
2022-03-24 17:55:32 +07:00
parent 9596b1a210
commit 7dfdef46a5
218 changed files with 8584 additions and 9108 deletions

View File

@@ -2,11 +2,11 @@
const process = require('node:process');
const { Collection } = require('@discordjs/collection');
const { OverwriteType, Routes } = require('discord-api-types/v9');
const CachedManager = require('./CachedManager');
const { TypeError } = require('../errors');
const PermissionOverwrites = require('../structures/PermissionOverwrites');
const { Role } = require('../structures/Role');
const { OverwriteTypes } = require('../util/Constants');
let cacheWarningEmitted = false;
@@ -58,7 +58,7 @@ class PermissionOverwriteManager extends CachedManager {
* message.channel.permissionOverwrites.set([
* {
* id: message.author.id,
* deny: [PermissionsFlagsBit.ViewChannel],
* deny: [Permissions.FLAGS.VIEW_CHANNEL],
* },
* ], 'Needed to change permissions');
*/
@@ -94,15 +94,18 @@ class PermissionOverwriteManager extends CachedManager {
if (typeof type !== 'number') {
userOrRole = this.channel.guild.roles.resolve(userOrRole) ?? this.client.users.resolve(userOrRole);
if (!userOrRole) throw new TypeError('INVALID_TYPE', 'parameter', 'User nor a Role');
type = userOrRole instanceof Role ? OverwriteType.Role : OverwriteType.Member;
type = userOrRole instanceof Role ? OverwriteTypes.role : OverwriteTypes.member;
}
const { allow, deny } = PermissionOverwrites.resolveOverwriteOptions(options, existing);
await this.client.api.channels(this.channel.id).permissions(userOrRoleId).put({
body: { id: userOrRoleId, type, allow, deny },
reason,
});
await this.client.api
.channels(this.channel.id)
.permissions(userOrRoleId)
.put({
data: { id: userOrRoleId, type, allow, deny },
reason,
});
return this.channel;
}