mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-14 02:23:31 +01: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:
@@ -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));
|
||||||
|
|||||||
Reference in New Issue
Block a user