logging.py 403 B

123456789101112131415
  1. import discord
  2. import os
  3. from typing import Optional
  4. from query.guild import get_output_channel
  5. async def report(bot, message, guild: Optional[discord.Guild]=None):
  6. channel = bot.get_channel(bot.OUTPUT_CHANNEL_ID)
  7. if guild:
  8. message = f"**{guild}** | {message}"
  9. try: channel = bot.get_channel(get_output_channel(guild.id))
  10. except: pass
  11. await channel.send(message)