Avoid util race conditions

This commit is contained in:
Adriene Hutchins 2020-03-02 23:50:39 -05:00
parent 01d657a214
commit 258afada1f
1 changed files with 5 additions and 6 deletions

View File

@ -17,26 +17,25 @@ class Logging():
def __init__(self, bot):
self.bot = bot
self.request = bot.request
self.online = bot.online
self.maintenance = bot.maintenance
# Sets info hook first
self.info_hook = self.online.get_webhook(
self.info_hook = self.bot.online.get_webhook(
bot.config['INFO_HOOK'] if bot.config['INFO_HOOK']
else None
)
# Sets other hooks or defaults them
if self.info_hook:
self.warn_hook = self.online.get_webhook(
self.warn_hook = self.bot.online.get_webhook(
bot.config['WARN_HOOK'] if bot.config['WARN_HOOK']
else self.info_hook
)
self.error_hook = self.online.get_webhook(
self.error_hook = self.bot.online.get_webhook(
bot.config['ERROR_HOOK'] if bot.config['ERROR_HOOK']
else self.info_hook
)
self.debug_hook = self.online.get_webhook(
self.debug_hook = self.bot.online.get_webhook(
bot.config['DEBUG_HOOK'] if bot.config['DEBUG_HOOK']
else self.info_hook
)
@ -57,7 +56,7 @@ class Logging():
# Hastebins Traceback
try:
url = await self.online.hastebin(
url = await self.bot.online.hastebin(
''.join(original_exc))
except Exception as e:
url = None