mirror of
https://github.com/danbulant/discord.js
synced 2026-06-01 13:52:02 +00:00
refactor(GuildMemberManager): use data instead of query (#4370)
This commit is contained in:
parent
1fbaf8816e
commit
49ad279c52
1 changed files with 2 additions and 2 deletions
|
|
@ -178,12 +178,12 @@ class GuildMemberManager extends BaseManager {
|
|||
* .catch(console.error);
|
||||
*/
|
||||
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);
|
||||
if (!id) return Promise.reject(new Error('BAN_RESOLVE_ID', true));
|
||||
return this.client.api
|
||||
.guilds(this.guild.id)
|
||||
.bans[id].put({ query: options })
|
||||
.bans[id].put({ data: options })
|
||||
.then(() => {
|
||||
if (user instanceof GuildMember) return user;
|
||||
const _user = this.client.users.resolve(id);
|
||||
|
|
|
|||
Loading…
Reference in a new issue