Esempio n. 1
0
def add_infraction(guild_id, user_id, mod_id, type, reason, end=None, active=True):
    Infraction.create(guild_id=guild_id, user_id=user_id, mod_id=mod_id, type=type, reason=reason,
                      start=datetime.now(), end=end, active=active)
    if f"{guild_id}_{user_id}" in cache.keys():
        del cache[f"{guild_id}_{user_id}"]
    if f"{guild_id}_{None}" in cache.keys():
        del cache[f"{guild_id}_{None}"]
Esempio n. 2
0
def add_infraction(guild_id, user_id, mod_id, type, reason):
    Infraction.create(guild_id=guild_id,
                      user_id=user_id,
                      mod_id=mod_id,
                      type=type,
                      reason=reason,
                      timestamp=datetime.now())
    if f"{guild_id}_{user_id}" in cache.keys():
        del cache[f"{guild_id}_{user_id}"]
Esempio n. 3
0
def add_infraction(guild_id,
                   user_id,
                   mod_id,
                   type,
                   reason,
                   end=None,
                   active=True):
    i = Infraction.create(guild_id=guild_id,
                          user_id=user_id,
                          mod_id=mod_id,
                          type=type,
                          reason=reason,
                          start=datetime.now(),
                          end=end,
                          active=active)
    bot.loop.create_task(clear_cache(guild_id))
    return i