Example #1
0
File: bot.py Project: MeGaTG/pybot
def on_binlog_replay_end():
    global started
    started = True
    config = load_config()
    utils.save_cfg_settings(config)
    handle_sudoers(config)
    utils.load_enabled_plugins()
    cron_plugins()
Example #2
0
def on_binlog_replay_end():
    global started
    started = True
    config = load_config()
    utils.save_cfg_settings(config)
    handle_sudoers(config)
    utils.load_enabled_plugins()
    cron_plugins()
Example #3
0
def run(msg, matches):
    receiver = utils.get_receiver_id(msg)
    if len(matches) == 1:
        if matches[0] == "!plugins":
            return list_plugins(receiver=receiver)
        elif matches[0] == "reload":
            utils.load_enabled_plugins()
            return list_plugins(True)
    elif len(matches) == 2:
        if matches[0] == 'enable':
            return enable_plugin(matches[1], receiver)
        else:
            print("Disable {} on this chat".format(matches[1]))
            return disable_plugin(matches[1], receiver)
    elif len(matches) == 3:
        if matches[0] == 'enable':
            return enable_plugin_chat(matches[1], receiver)
        else:
            return disable_plugin_chat(matches[1], receiver)
Example #4
0
def run(msg, matches):
    receiver = utils.get_receiver_id(msg)
    if len(matches) == 1:
        if matches[0] == "!plugins":
            return list_plugins(receiver=receiver)
        elif matches[0] == "reload":
            utils.load_enabled_plugins()
            return list_plugins(True)
    elif len(matches) == 2:
        if matches[0] == "enable":
            return enable_plugin(matches[1], receiver)
        else:
            print("Disable {} on this chat".format(matches[1]))
            return disable_plugin(matches[1], receiver)
    elif len(matches) == 3:
        if matches[0] == "enable":
            return enable_plugin_chat(matches[1], receiver)
        else:
            return disable_plugin_chat(matches[1], receiver)