mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +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);
|
||||
*/
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user