Punishment System in Global Chat Using Discord.js

Asked 2 years ago, Updated 2 years ago, 59 views

I use Discord.js to create a global chat.
This person made it by referring to the website .
So I thought that if you can't mute it, it might get rough, so I asked you a question.
Do you know where to detect commands? I don't know how to do Mute Ban.
I would like to delete the message that was not adapted to all servers when I spoke in the global chat room.
Statement->BOT detected->Delete messages->I want to prevent messages from being sent to all servers I deploy.
Please reply.

javascript discord

2022-09-30 10:14

2 Answers

I have blacklisted filters like this.
The else part is return; but I think it can be replaced.

const blacklist=["ID of the person to mute here"]

if(blacklist.includes(message.author.id)){
    message.delete()
} else {
    // Processing
}


2022-09-30 10:14

It is necessary to properly design who will not spread certain user statements to other servers, but if the user's ID is available, you can filter it before sending the message on the bot side.You have a blacklist of user IDs on the bot side and check each message.


2022-09-30 10:14

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.