mirror of
https://github.com/danbulant/discord.js
synced 2026-06-24 17:21:59 +00:00
feat(GuildMemberManager): throw TypeError on incorrect GuildMemberManager#ban params (#4816)
Co-authored-by: Sugden <28943913+NotSugden@users.noreply.github.com>
This commit is contained in:
parent
1f4b9fe749
commit
863734aba4
1 changed files with 1 additions and 0 deletions
|
|
@ -210,6 +210,7 @@ class GuildMemberManager extends BaseManager {
|
||||||
* .catch(console.error);
|
* .catch(console.error);
|
||||||
*/
|
*/
|
||||||
ban(user, options = { days: 0 }) {
|
ban(user, options = { days: 0 }) {
|
||||||
|
if (typeof options !== 'object') return Promise.reject(new TypeError('INVALID_TYPE', 'options', 'object', true));
|
||||||
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));
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue