1
0

settings.py 480 B

12345678910111213
  1. from query.user import is_ignored
  2. from query.channel import get_games
  3. async def check_ignore(pg, user, games_channel=None):
  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. user.send(f"Games are disabled in {games_channel}, ask an admin to enable them.")
  11. return True