settings.py 489 B

1234567891011121314
  1. from query.user import is_ignored
  2. from query.channel import get_games
  3. async def check_ignore(pg, user, games_channel=False):
  4. # Ignore user if on the ignore list.
  5. if await is_ignored(pg, user.id):
  6. return True
  7. # Ignore if games are disabled for channel.
  8. if games_channel: # Invoked by a game command.
  9. if not await get_games(pg, games_channel.id): # Warn if games are off.
  10. await user.send(f"Games are disabled in {games_channel}, ask an admin to enable them.")
  11. return True