CHG: Remove unecessary variable, move dbg command to end of utils.py

ipm
Kamal Curi 2 years ago
parent cccfc84f4a
commit 360ac16070

@ -40,8 +40,6 @@ last_rq = {}
last_rqer = ''
rq_abusers = {}
last_quote = 0
@client.event
async def on_message(message):
content = str(message.content)
@ -159,9 +157,6 @@ async def random_quote(bot: object) -> str:
if stack_len >= stack_limit:
quote_id_stack.pop(0)
global last_quote
last_quote = int(chosen_one.id)
# Writes to persistent stackfile
with open(QUOTE_STACK, mode='w') as f:
json.dump(quote_id_stack, f)
@ -530,34 +525,6 @@ async def random_quote_leaderboard(bot:object) -> str:
return await bot.send(data)
@client.command(aliases=['dbg'])
async def neeble_debug(bot:object) -> str:
"""
Outputs debug data.
"""
# TODO: This is repeated role checking code from the deletion function, better make this into one function itself
roles = [r.name for r in bot.author.roles]
PermStatus = False
if len(PERMISSIONS['dq']) < 1 or not len(set(PERMISSIONS['dq']).intersection(roles)) < 1:
PermStatus = True
if not PermStatus:
return await bot.send("_And who the fuck do **YOU** think you are!?_.\n"\
"(You don't have the necessary role for this command)")
qt_count = count_quotes()
st_size = len(quote_id_stack)
ct_authors = str(quote_content.keys())
lrqers = last_rq.keys()
lrqer = last_rqer
abusers = rq_abusers
rl_drum = drum
rl_chmb = chamber
return await bot.send(f"```\nqt_count:{qt_count}\nst_size:{st_size}\nst_limit:{stack_limit}\nlst_qt:{last_quote}\nct_authors:{ct_authors}\nlrqers:{lrqers}\nlrqer:{lrqer}\nabusers:{abusers}\nrl_drum:{rl_drum}\nrl_chmb:{rl_chmb}```")
@client.command(aliases=['dr', 'droll'])
async def dice_roll(bot:object, size:int=6) -> str:
"""
@ -591,4 +558,31 @@ async def roulette(bot:object) -> str:
drum = []
return await bot.send(f"BANG! {bot.author.name} died.")
else:
return await bot.send("Click!")
@client.command(aliases=['dbg'])
async def neeble_debug(bot:object) -> str:
"""
Outputs debug data.
"""
# TODO: This is repeated role checking code from the deletion function, better make this into one function itself
roles = [r.name for r in bot.author.roles]
PermStatus = False
if len(PERMISSIONS['dq']) < 1 or not len(set(PERMISSIONS['dq']).intersection(roles)) < 1:
PermStatus = True
if not PermStatus:
return await bot.send("_And who the fuck do **YOU** think you are!?_.\n"\
"(You don't have the necessary role for this command)")
clock = comlock
qt_count = count_quotes()
st_size = len(quote_id_stack)
last_quote = quote_id_stack[-1]
ct_authors = str(quote_content.keys())
lrqers = last_rq.keys()
lrqer = last_rqer
abusers = rq_abusers
rl_drum = drum
rl_chmb = chamber
return await bot.send(f"```\ncomlock:{clock}\nqt_count:{qt_count}\nst_size:{st_size}\nst_limit:{stack_limit}\nlst_qt:{last_quote}\nct_authors:{ct_authors}\nlrqers:{lrqers}\nlrqer:{lrqer}\nabusers:{abusers}\nrl_drum:{rl_drum}\nrl_chmb:{rl_chmb}```")
Loading…
Cancel
Save