mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-20 13:33:30 +01:00
refactor(GuildMemberManager): use data instead of query (#4370)
This commit is contained in:
@@ -178,12 +178,12 @@ class GuildMemberManager extends BaseManager {
|
|||||||
* .catch(console.error);
|
* .catch(console.error);
|
||||||
*/
|
*/
|
||||||
ban(user, options = { days: 0 }) {
|
ban(user, options = { days: 0 }) {
|
||||||
if (options.days) options['delete-message-days'] = options.days;
|
if (options.days) options.delete_message_days = options.days;
|
||||||
const id = this.client.users.resolveID(user);
|
const id = this.client.users.resolveID(user);
|
||||||
if (!id) return Promise.reject(new Error('BAN_RESOLVE_ID', true));
|
if (!id) return Promise.reject(new Error('BAN_RESOLVE_ID', true));
|
||||||
return this.client.api
|
return this.client.api
|
||||||
.guilds(this.guild.id)
|
.guilds(this.guild.id)
|
||||||
.bans[id].put({ query: options })
|
.bans[id].put({ data: options })
|
||||||
.then(() => {
|
.then(() => {
|
||||||
if (user instanceof GuildMember) return user;
|
if (user instanceof GuildMember) return user;
|
||||||
const _user = this.client.users.resolve(id);
|
const _user = this.client.users.resolve(id);
|
||||||
|
|||||||
Reference in New Issue
Block a user