Merge pull request #16 from sirocyl/patch-2

Add sha256 + windows newlines check to welcome processing.
This commit is contained in:
Ave 2019-02-21 07:49:00 +00:00 committed by GitHub
commit 4164786b40
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -180,12 +180,18 @@ class Verification:
# Now add the same things but with newlines at the end of them # Now add the same things but with newlines at the end of them
allowed_names += [(an + '\n') for an in allowed_names] allowed_names += [(an + '\n') for an in allowed_names]
close_names += [(cn + '\n') for cn in close_names] close_names += [(cn + '\n') for cn in close_names]
allowed_names += [(an + '\r\n') for an in allowed_names]
close_names += [(cn + '\r\n') for cn in close_names]
allowed_names += [(an + '\r') for an in allowed_names] # [ ͡° ͜ᔦ ͡°] 𝐖𝐞𝐥𝐜𝐨𝐦𝐞 𝐭𝐨 𝐌𝐚𝐜 𝐎𝐒 𝟗.
close_names += [(cn + '\r') for cn in close_names]
# Finally, hash the stuff so that we can access them later :) # Finally, hash the stuff so that we can access them later :)
sha1_allow = [hashlib.sha1(name.encode('utf-8')).hexdigest() sha1_allow = [hashlib.sha1(name.encode('utf-8')).hexdigest()
for name in allowed_names] for name in allowed_names]
md5_allow = [hashlib.md5(name.encode('utf-8')).hexdigest() md5_allow = [hashlib.md5(name.encode('utf-8')).hexdigest()
for name in allowed_names] for name in allowed_names]
sha256_allow = [hashlib.sha256(name.encode('utf-8')).hexdigest()
for name in allowed_names]
sha1_close = [hashlib.sha1(name.encode('utf-8')).hexdigest() sha1_close = [hashlib.sha1(name.encode('utf-8')).hexdigest()
for name in close_names] for name in close_names]
@ -197,6 +203,8 @@ class Verification:
await chan.send(f"{message.author.mention} :no_entry: Close, but incorrect. You got the process right, but you're not doing it on your name and discriminator properly. Please re-read the rules carefully and look up any terms you are not familiar with.") await chan.send(f"{message.author.mention} :no_entry: Close, but incorrect. You got the process right, but you're not doing it on your name and discriminator properly. Please re-read the rules carefully and look up any terms you are not familiar with.")
elif any(allow in mcl for allow in md5_allow): elif any(allow in mcl for allow in md5_allow):
await chan.send(f"{message.author.mention} :no_entry: Close, but incorrect. You're processing your name and discriminator properly, but you're not using the right process. Please re-read the rules carefully and look up any terms you are not familiar with.") await chan.send(f"{message.author.mention} :no_entry: Close, but incorrect. You're processing your name and discriminator properly, but you're not using the right process. Please re-read the rules carefully and look up any terms you are not familiar with.")
elif any(allow in mcl for allow in sha256_allow):
await chan.send(f"{message.author.mention} :no_entry: Close, but incorrect. You're processing your name and discriminator properly, but you're not using the right process. Please re-read the rules carefully and look up any terms you are not familiar with.")
elif full_name in message.content or str(member.id) in message.content or member.name in message.content or discrim in message.content: elif full_name in message.content or str(member.id) in message.content or member.name in message.content or discrim in message.content:
await chan.send(f"{message.author.mention} :no_entry: Incorrect. You need to do something *specific* with your name and discriminator instead of just posting it. Please re-read the rules carefully and look up any terms you are not familiar with.") await chan.send(f"{message.author.mention} :no_entry: Incorrect. You need to do something *specific* with your name and discriminator instead of just posting it. Please re-read the rules carefully and look up any terms you are not familiar with.")