From f1c0bd07ad2db3f4d38449e31398d7b39cad568e Mon Sep 17 00:00:00 2001 From: March 7th <71698422+aiko-chan-ai@users.noreply.github.com> Date: Thu, 16 Jun 2022 18:55:38 +0700 Subject: [PATCH] feat(TextBasedChannel): User cannot use `bulkDelete` --- src/structures/interfaces/TextBasedChannel.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/structures/interfaces/TextBasedChannel.js b/src/structures/interfaces/TextBasedChannel.js index fea446e..a3b9cbd 100644 --- a/src/structures/interfaces/TextBasedChannel.js +++ b/src/structures/interfaces/TextBasedChannel.js @@ -294,6 +294,7 @@ class TextBasedChannel { * .catch(console.error); */ async bulkDelete(messages, filterOld = false) { + if (!this.client.user.bot) throw new Error('INVALID_USER_METHOD'); if (Array.isArray(messages) || messages instanceof Collection) { let messageIds = messages instanceof Collection ? [...messages.keys()] : messages.map(m => m.id ?? m); if (filterOld) {