Fix botlist

This commit is contained in:
Adriene Hutchins 2020-03-19 18:31:08 -04:00
parent 61c2f6aecd
commit 664e1361c5
4 changed files with 25 additions and 10 deletions

View file

@ -22,22 +22,26 @@ class Logging():
# Sets info hook first
self.info_hook = self.online.get_webhook(
bot.config['HOOKS']['INFO_HOOK'] if bot.config['HOOKS']['INFO_HOOK']
bot.config['HOOKS']['INFO_HOOK']
if bot.config['HOOKS']['INFO_HOOK']
else None
)
# Sets other hooks or defaults them
if self.info_hook:
self.warn_hook = self.online.get_webhook(
bot.config['HOOKS']['WARN_HOOK'] if bot.config['HOOKS']['WARN_HOOK']
bot.config['HOOKS']['WARN_HOOK']
if bot.config['HOOKS']['WARN_HOOK']
else self.info_hook
)
self.error_hook = self.online.get_webhook(
bot.config['HOOKS']['ERROR_HOOK'] if bot.config['HOOKS']['ERROR_HOOK']
bot.config['HOOKS']['ERROR_HOOK']
if bot.config['HOOKS']['ERROR_HOOK']
else self.info_hook
)
self.debug_hook = self.online.get_webhook(
bot.config['HOOKS']['DEBUG_HOOK'] if bot.config['HOOKS']['DEBUG_HOOK']
bot.config['HOOKS']['DEBUG_HOOK']
if bot.config['HOOKS']['DEBUG_HOOK']
else self.info_hook
)
@ -102,7 +106,9 @@ class Logging():
if self.info_hook:
return await self.info_hook.send(
content=content,
username=f"{self.bot.user.name} - {name if name else 'unknown'}",
username=(
f"{self.bot.user.name} - {name if name else 'unknown'}"
),
avatar_url=str(self.bot.user.avatar_url),
embed=embed
)