logging.py 442 B

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