mirror of
https://github.com/Ryujinx/ryuko-ng.git
synced 2024-12-22 20:25:34 +00:00
Place hash_allow within reset
This commit is contained in:
parent
6ec56d56ed
commit
0a8dae2c41
|
@ -106,11 +106,12 @@ welcome_footer = (
|
||||||
""",
|
""",
|
||||||
)
|
)
|
||||||
|
|
||||||
hidden_term_line = ' • When you have finished reading all of the rules, send a message in this channel that includes the {0} hash of your discord "name#discriminator" (for example, {0}(User#1234)), and we\'ll grant you access to the other channels. You can find your "name#discriminator" (your username followed by a ‘#’ and four numbers) under the discord channel list.'.format(hash_choice.upper())
|
hidden_term_line = ' • When you have finished reading all of the rules, send a message in this channel that includes the {0} hash of your discord "name#discriminator" (for example, {0}(User#1234)), and we\'ll grant you access to the other channels. You can find your "name#discriminator" (your username followed by a ‘#’ and four numbers) under the discord channel list.'
|
||||||
|
|
||||||
class Verification(Cog):
|
class Verification(Cog):
|
||||||
def __init__(self, bot):
|
def __init__(self, bot, hash_choice):
|
||||||
self.bot = bot
|
self.bot = bot
|
||||||
|
self.hash_choice = random.choice(tuple(hashlib.algorithms_guaranteed))
|
||||||
|
|
||||||
@commands.check(check_if_staff)
|
@commands.check(check_if_staff)
|
||||||
@commands.command()
|
@commands.command()
|
||||||
|
@ -127,13 +128,13 @@ class Verification(Cog):
|
||||||
rules = ['**{}**. {}'.format(i, cleandoc(r)) for i, r in
|
rules = ['**{}**. {}'.format(i, cleandoc(r)) for i, r in
|
||||||
enumerate(welcome_rules, 1)]
|
enumerate(welcome_rules, 1)]
|
||||||
rule_choice = random.randint(2, len(rules))
|
rule_choice = random.randint(2, len(rules))
|
||||||
rules[rule_choice - 1] += '\n' + hidden_term_line
|
rules[rule_choice - 1] += '\n' + hidden_term_line.format(self.hash_choice.upper())
|
||||||
msg = f"🗑 **Reset**: {ctx.author.mention} cleared {limit} messages "\
|
msg = f"🗑 **Reset**: {ctx.author.mention} cleared {limit} messages "\
|
||||||
f" in {ctx.channel.mention}"
|
f" in {ctx.channel.mention}"
|
||||||
msg += f"\n💬 __Current challenge location__: under rule {rule_choice}"
|
msg += f"\n💬 __Current challenge location__: under rule {rule_choice}"
|
||||||
log_channel = self.bot.get_channel(config.log_channel)
|
log_channel = self.bot.get_channel(config.log_channel)
|
||||||
await log_channel.send(msg)
|
await log_channel.send(msg)
|
||||||
|
|
||||||
# find rule that puts us over 2,000 characters, if any
|
# find rule that puts us over 2,000 characters, if any
|
||||||
total = 0
|
total = 0
|
||||||
messages = []
|
messages = []
|
||||||
|
@ -198,8 +199,7 @@ class Verification(Cog):
|
||||||
close_names += [(cn + '\r') for cn in close_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 :)
|
||||||
hash_choice = random.choice(tuple(hashlib.algorithms_guaranteed))
|
hash_allow = [hashlib.new(self.hash_choice, name.encode('utf-8')).hexdigest()
|
||||||
hash_allow = [hashlib.new(hash_choice, name.encode('utf-8')).hexdigest()
|
|
||||||
for name in allowed_names]
|
for name in allowed_names]
|
||||||
|
|
||||||
# I'm not even going to attempt to break those into lines jfc
|
# I'm not even going to attempt to break those into lines jfc
|
||||||
|
|
Loading…
Reference in a new issue