feat(TextBasedChannel): User cannot use bulkDelete

This commit is contained in:
March 7th 2022-06-16 18:55:38 +07:00
parent dce9c8013c
commit f1c0bd07ad

View File

@ -294,6 +294,7 @@ class TextBasedChannel {
* .catch(console.error); * .catch(console.error);
*/ */
async bulkDelete(messages, filterOld = false) { async bulkDelete(messages, filterOld = false) {
if (!this.client.user.bot) throw new Error('INVALID_USER_METHOD');
if (Array.isArray(messages) || messages instanceof Collection) { if (Array.isArray(messages) || messages instanceof Collection) {
let messageIds = messages instanceof Collection ? [...messages.keys()] : messages.map(m => m.id ?? m); let messageIds = messages instanceof Collection ? [...messages.keys()] : messages.map(m => m.id ?? m);
if (filterOld) { if (filterOld) {