Discord Link Filter
Hello! So I have this filter in my bot setup to not allow links. However, I had recently setup a level system allowing links to people over level 20 (in the code it is line 157 which ends in return;). However, even though level 20 role can send links, there is still some I want to be filtered. Do you know how I would do this?
The filter runs completely fine and it filters peopel who send links, and it doesn't filter links sent by people with level 20. I just want to know if it is possible to filter certain links even with the bypass role.
8 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!How do you handle lvl 20 ?
You can do something like
it's through roles. Once the user reaches a certain level from chatting, the bot gives them the level 20 role
Then do something like this, also change the post's tag, this is v13 code not v14
still doesn't filter the links even with the bypass role
Because you return if someone has that role
So the code will never reach that point
not related to your problem, but the way you check for links is very easy to bypass
use a regex instead