Example #1
0
def del_contributors(qq, config):
    if qq > 0:
        if qq == config['master']:
            reply_text = '他是主人哦~'
        elif qq in config['administrator']:
            reply_text = '该成员已经是管理员啦,不是贡献者'
        elif not qq in config['contributor']:
            reply_text = '该成员不在贡献者计划中哦~'
        else:
            config['contributor'].remove(qq)
            dataManage.save_config(config)
            reply_text = '删除成功~'
    else:
        reply_text = '诶?这个QQ正确吗?'
    return reply_text
Example #2
0
def add_contributors(qq, config):
    if qq > 0:
        if qq == config['master']:
            reply_text = '他是主人哦~'
        elif qq in config['administrator']:
            reply_text = '该成员已经是管理员了'
        elif qq in config['contributor']:
            reply_text = '该成员已经在贡献者计划中了哦~'
        else:
            config['contributor'].append(qq)
            dataManage.save_config(config)
            reply_text = '添加成功~'
    else:
        reply_text = '诶?这个QQ正确吗?'
    return reply_text
Example #3
0
def del_administrator(qq, config):
    if qq > 0:
        if qq == config['master']:
            reply_text = '他是主人哦~不能从管理员中移除'
        elif not (qq in config["administrator"]):
            reply_text = '该成员不是管理员哦~'
            if qq in config["contributor"]:
                reply_text += '但是该成员是贡献者,已经移除他的权限'
                config["contributor"].remove(qq)
                dataManage.save_config(config)
        else:
            config["administrator"].remove(qq)
            dataManage.save_config(config)
            reply_text = '删除成功~'
    else:
        reply_text = '诶?这个QQ正确吗?'
    return reply_text
Example #4
0
def add_administrator(qq, config):
    if qq > 0:
        if qq == config['master']:
            reply_text = '他是主人哦~'
        elif qq in config['administrator']:
            reply_text = '该成员已经是管理员了'
        elif qq in config['contributor']:
            config["contributor"].remove(qq)
            config["administrator"].append(qq)
            dataManage.save_config(config)
            reply_text = '已将该成员的权限从贡献者升为了管理员'
        else:
            config["administrator"].append(qq)
            dataManage.save_config(config)
            reply_text = '添加成功~'
    else:
        reply_text = '诶?这个QQ正确吗?'
    return reply_text
Example #5
0
        'master_right': [],
        'administrator': bot_information['administrator'],
        'contributor': bot_information['contributors'],
        'RPG_administrator': [],

        'blacklist_group': {},
        'blacklist_member': {},
        'test_group': bot_information['testGroup']
    }

    for i in bot_information['blacklistGroup']:
        config['blacklist_group'][i] = '未知原因,诞生于增加原因之前'
    for i in bot_information['blacklistMember']:
        config['blacklist_member'][i] = '未知原因,诞生于增加原因之前'

    dataManage.save_config(config)

    groups = {}
    users = {}

    for id in bot_information['cursePlanGroup']:
        if not groups.__contains__(id):
            groups[id] = dataManage.read_group(id)
        groups[id]['config']['curse'] = False
        dataManage.save_group(id, groups[id])
    
    for id in bot_information['mute']:
        if not groups.__contains__(id):
            groups[id] = dataManage.read_group(id)
        groups[id]['config']['mute'] = True
        dataManage.save_group(id, groups[id])
Example #6
0
def remove_blacklist_member(qq, config):
    if not config['blacklist_group'].__contains__(qq):
        return '该人不在黑名单里'
    del config["blacklist_group"][qq]
    dataManage.save_config(config)
    return '已经将人' + str(qq) + '移除黑名单'
Example #7
0
def remove_blacklist_group(group_id, config):
    if not config['blacklist_group'].__contains__(group_id):
        return '该群不在黑名单里'
    del config["blacklistGroup"][group_id]
    dataManage.save_config(config)
    return '已经将群' + str(group_id) + '移除黑名单'
Example #8
0
def add_blacklist_member(qq, reason, config):
    if config['blacklist_member'].__contains__(qq):
        return '该人已经因为“' + config['blacklist_member'][qq] + '”被列入黑名单'
    config['blacklist_member'][qq] = reason
    dataManage.save_config(config)
    return '已经将人' + str(qq) + '加入黑名单'
Example #9
0
def add_blacklist_group(group_id, reason, config):
    if config['blacklist_group'].__contains__(group_id):
        return '该群已经因为“' + config['blacklist_group'][group_id] + '”被列入黑名单'
    config['blacklist_group'][group_id] = reason
    dataManage.save_config(config)
    return '已经将群' + str(group_id) + '加入黑名单'
Example #10
0
def change_bot_qq(qq, config):
    config['qq'] = qq
    dataManage.save_config(config)
    return '修改成功!当前QQ:' + str(qq)
Example #11
0
def change_bot_name(name, config):
    config['name'] = name
    dataManage.save_config(config)
    return '修改成功!当前名字:' + name
Example #12
0
def change_version(version, config):
    config['version'] = version
    dataManage.save_config(config)
    return '修改成功!当前版本:' + version