made some altercations to ajds harmful identifier

This commit is contained in:
Ben
2020-08-06 20:24:18 +01:00
parent 1502e97092
commit 6b24bb7c9e
2 changed files with 6 additions and 3 deletions

View File

@@ -122,13 +122,12 @@ module.exports.NickCheck = function(name)
module.exports.IsIdentifierHarmful = function(ident)
{
return !(/^[a-zA-Z0-9_][a-zA-Z0-9_!?-]{3,20}$/.test(ident));
return !(/^[a-zA-Z0-9_ ][a-zA-Z0-9_!?-]{3,999}$/.test(ident));
}
module.exports.NeutralizeHarmfulIdentifier = function(ident)
{
let base = ident.replace(/[^a-zA-Z0-9_]/g, '');
if (base.length > 20) base = base.slice(0, 20);
let base = ident.replace(/[^a-zA-Z0-9_ ]/g, '');
while (base.length < 3) {
base += `UnPingableNick${Math.floor(Math.random()*10 + 0.5)}`;
}

View File

@@ -608,6 +608,8 @@ async function GuildMemberRemove(guild, member)
DiscordHelpers.SendMessageSafe(FallbackChannel, { embed: embed.sendable });
}
async function GuildMemberUpdate()
async function MessageDelete(message)
{
const FallbackChannel = await GetLogChannel(message.channel.guild.id);
@@ -688,3 +690,5 @@ async function MessageUpdate(message, oldmessage)
DiscordHelpers.SendMessageSafe(FallbackChannel, { embed: embed.sendable });
}