feat(TextBasedChannel): User cannot use bulkDelete
This commit is contained in:
parent
dce9c8013c
commit
f1c0bd07ad
@ -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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user