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:
monbrey
2020-11-23 05:13:07 +11:00
committed by GitHub
parent 1f4b9fe749
commit 863734aba4

View File

@@ -210,6 +210,7 @@ class GuildMemberManager extends BaseManager {
* .catch(console.error);
*/
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;
const id = this.client.users.resolveID(user);
if (!id) return Promise.reject(new Error('BAN_RESOLVE_ID', true));