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.
No description
8 Replies
d.js toolkit
d.js toolkit10mo ago
- 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!
NyR
NyR10mo ago
How do you handle lvl 20 ? You can do something like
if ( Level > 20 && message.content.includes('Your Link') {
// Handle your rejection logic here
}
if ( Level > 20 && message.content.includes('Your Link') {
// Handle your rejection logic here
}
traavvypatty
traavvypattyOP10mo ago
it's through roles. Once the user reaches a certain level from chatting, the bot gives them the level 20 role
NyR
NyR10mo ago
Then do something like this, also change the post's tag, this is v13 code not v14
traavvypatty
traavvypattyOP10mo ago
No description
traavvypatty
traavvypattyOP10mo ago
still doesn't filter the links even with the bypass role
NyR
NyR10mo ago
Because you return if someone has that role So the code will never reach that point
-Carlos👑
-Carlos👑10mo ago
not related to your problem, but the way you check for links is very easy to bypass use a regex instead
Want results from more Discord servers?
Add your server