no http links after filtering
This commit is contained in:
parent
9f7495a336
commit
70d8eb1385
|
@ -48,10 +48,6 @@ class ChatProvider {
|
|||
}
|
||||
|
||||
async sendMessage(user, message) {
|
||||
if (message.length > 200) {
|
||||
// eslint-disable-next-line max-len
|
||||
return 'You can\'t send a message this long :(';
|
||||
}
|
||||
const name = (user.regUser) ? user.regUser.name : null;
|
||||
const country = (name.endsWith('berg') || name.endsWith('stein'))
|
||||
? 'il'
|
||||
|
@ -83,6 +79,15 @@ class ChatProvider {
|
|||
message = message.replace(subsitute.regexp, subsitute.replace);
|
||||
}
|
||||
|
||||
if (message.includes('http')) {
|
||||
return 'no shitty links pls';
|
||||
}
|
||||
|
||||
if (message.length > 200) {
|
||||
// eslint-disable-next-line max-len
|
||||
return 'You can\'t send a message this long :(';
|
||||
}
|
||||
|
||||
if (user.isAdmin() && message.charAt(0) === '/') {
|
||||
// admin commands
|
||||
const cmdArr = message.split(' ');
|
||||
|
|
Loading…
Reference in New Issue
Block a user