mirror of
https://github.com/danbulant/discord.js
synced 2026-05-24 12:35:53 +00:00
Stop using deprecated methods within discord.js (#1441)
* fix deprecation stuff * fixed a check
This commit is contained in:
parent
166161d6d3
commit
a02e10926d
3 changed files with 6 additions and 6 deletions
|
|
@ -263,7 +263,7 @@ class GuildMember {
|
|||
if (this.user.id === this.guild.ownerID) return false;
|
||||
if (this.user.id === this.client.user.id) return false;
|
||||
const clientMember = this.guild.member(this.client.user);
|
||||
if (!clientMember.hasPermission(Permissions.FLAGS.KICK_MEMBERS)) return false;
|
||||
if (!clientMember.permissions.has(Permissions.FLAGS.KICK_MEMBERS)) return false;
|
||||
return clientMember.highestRole.comparePositionTo(this.highestRole) > 0;
|
||||
}
|
||||
|
||||
|
|
@ -276,7 +276,7 @@ class GuildMember {
|
|||
if (this.user.id === this.guild.ownerID) return false;
|
||||
if (this.user.id === this.client.user.id) return false;
|
||||
const clientMember = this.guild.member(this.client.user);
|
||||
if (!clientMember.hasPermission(Permissions.FLAGS.BAN_MEMBERS)) return false;
|
||||
if (!clientMember.permissions.has(Permissions.FLAGS.BAN_MEMBERS)) return false;
|
||||
return clientMember.highestRole.comparePositionTo(this.highestRole) > 0;
|
||||
}
|
||||
|
||||
|
|
@ -319,7 +319,7 @@ class GuildMember {
|
|||
*/
|
||||
hasPermissions(permissions, explicit = false) {
|
||||
if (!explicit && this.user.id === this.guild.ownerID) return true;
|
||||
return permissions.every(p => this.hasPermission(p, explicit));
|
||||
return this.hasPermission(permissions, explicit);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -329,7 +329,7 @@ class GuildMember {
|
|||
* @returns {PermissionResolvable[]}
|
||||
*/
|
||||
missingPermissions(permissions, explicit = false) {
|
||||
return permissions.filter(p => !this.hasPermission(p, explicit));
|
||||
return permissions.missing(permissions, explicit);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ class Role {
|
|||
get editable() {
|
||||
if (this.managed) return false;
|
||||
const clientMember = this.guild.member(this.client.user);
|
||||
if (!clientMember.hasPermission(Permissions.FLAGS.MANAGE_ROLES_OR_PERMISSIONS)) return false;
|
||||
if (!clientMember.permissions.has(Permissions.FLAGS.MANAGE_ROLES_OR_PERMISSIONS)) return false;
|
||||
return clientMember.highestRole.comparePositionTo(this) > 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -456,7 +456,7 @@ const Deprecated = {
|
|||
* @deprecated
|
||||
*/
|
||||
sendFile(attachment, name, content, options = {}) {
|
||||
return this.sendFiles([{ attachment, name }], content, options);
|
||||
return this.send({ files: [{ attachment, name }], content, options });
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue