Esempio n. 1
0
def ooc_cmd_bans(client, _arg):
    """
    Get the 5 most recent bans.
    Usage: /bans
    """
    msg = 'Last 5 bans:\n'
    for ban in database.recent_bans():
        time = arrow.get(ban.ban_date).humanize()
        msg += f'{time}: {ban.banned_by_name} ({ban.banned_by}) issued ban ' \
               f'{ban.ban_id} (\'{ban.reason}\')\n'
    client.send_ooc(msg)
Esempio n. 2
0
def ooc_cmd_bans(client, _arg: str) -> None:
    """
	Get the 5 most recent bans.
	Usage: /bans
	"""
    msg = 'Last 5 bans:\n'
    bandate = None
    for ban in database.recent_bans():
        if ban.ban_date == None or ban.ban_date == "None":
            bandate = "N/A"
        else:
            bandate = ban.ban_date
        time = bandate
        msg += f'{time}: {ban.banned_by_name} ({ban.banned_by}) issued ban ' \
            f'{ban.ban_id} (\'{ban.reason}\')\n'
    client.send_ooc(msg)