Skip to content

Commit

Permalink
feat(GuildMemberManager): throw TypeError on incorrect GuildMemberMan…
Browse files Browse the repository at this point in the history
…ager#ban params (#4816)

Co-authored-by: Sugden <[email protected]>
  • Loading branch information
monbrey and NotSugden authored Nov 22, 2020
1 parent 1f4b9fe commit 863734a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/managers/GuildMemberManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 863734a

Please sign in to comment.