Пример #1
0
def unrestrict(fro, chan, message):
    # Get parameters
    for i in message:
        i = i.lower()
    target = message[0]

    # Make sure the user exists
    targetUserID = userUtils.getIDSafe(target)
    userID = userUtils.getID(fro)
    if not targetUserID:
        return "{}: user not found".format(target)

    # Set allowed to 1
    userUtils.unrestrict(targetUserID)

    log.rap(userID, "has removed restricted mode from {}".format(target), True)
    return "Welcome back {}!".format(target)
Пример #2
0
def unrestrict(fro, chan, message):
    # Get parameters
    for i in message:
        i = i.lower()
    target = message[0]

    # Make sure the user exists
    targetUserID = userUtils.getIDSafe(target)
    userID = userUtils.getID(fro)
    if not targetUserID:
        return "{}: user not found".format(target)

    # Set allowed to 1
    userUtils.unrestrict(targetUserID)
    requests.get(glob.conf.config["discord"]["krbot"] + "api/v1/submitBanOrRestrict", params={
        'token': glob.conf.config["discord"]["krbotToken"],
        'banned': target,
        'type': 2,
        'author': fro
    })

    log.rap(userID, "has removed restricted mode from {}".format(target), True)
    return "Welcome back {}!".format(target)