def disable_plugin(name, receiver): if not utils.plugin_exists(name): return 'Plugin {} does not exists'.format(name) if not utils.plugin_enabled(name): return 'Plugin {} is not enabled'.format(name) generic_cfg(name, 'remove') print("Removed plugin {} to config file".format(name)) utils.reload_cfg_plugins() return list_plugins(True, receiver)
def disable_plugin(name, receiver): if not utils.plugin_exists(name): return "Plugin {} does not exists".format(name) if not utils.plugin_enabled(name): return "Plugin {} is not enabled".format(name) generic_cfg(name, "remove") print("Removed plugin {} to config file".format(name)) utils.reload_cfg_plugins() return list_plugins(True, receiver)
def enable_plugin(name, receiver): print("") if utils.plugin_enabled(name): return 'Plugin {} is enabled'.format(name) if utils.plugin_exists(name): generic_cfg(name, 'append') print("Added plugin {} to config file".format(name)) utils.reload_cfg_plugins() return list_plugins(True, receiver) else: return 'Plugin "{}" does not exists'.format(name)
def enable_plugin(name, receiver): print("") if utils.plugin_enabled(name): return "Plugin {} is enabled".format(name) if utils.plugin_exists(name): generic_cfg(name, "append") print("Added plugin {} to config file".format(name)) utils.reload_cfg_plugins() return list_plugins(True, receiver) else: return 'Plugin "{}" does not exists'.format(name)
def disable_plugin_chat(name, receiver): if not utils.plugin_exists(name): return "Plugin {} does not exists".format(name) cfg, data = getOrElse("disabled_plugins_on_chat", dict) plgs = data.get(receiver) or set() plgs.add(name) data[receiver] = plgs generic_cfg(data, "update", dict, field="disabled_plugins_on_chat") print("Disabled plugin {} in chat {} and saved".format(name, receiver)) cfg["disabled_plugins_on_chat"] = data utils.save_cfg_settings(cfg) return "Plugin {} disabled in the chat {}".format(name, utils.emojis["wut"])
def disable_plugin_chat(name, receiver): if not utils.plugin_exists(name): return 'Plugin {} does not exists'.format(name) cfg, data = getOrElse('disabled_plugins_on_chat', dict) plgs = data.get(receiver) or set() plgs.add(name) data[receiver] = plgs generic_cfg(data, 'update', dict, field='disabled_plugins_on_chat') print("Disabled plugin {} in chat {} and saved".format(name, receiver)) cfg['disabled_plugins_on_chat'] = data utils.save_cfg_settings(cfg) return "Plugin {} disabled in the chat {}".format(name, utils.emojis['wut'])
def enable_plugin_chat(name, receiver): if not utils.plugin_exists(name): return "Plugin {} does not exists".format(name) if not utils.is_plugin_disabled_on_chat(name, receiver): return "Plugin {} is not disabled in this chat".format(name) cfg, data = getOrElse("disabled_plugins_on_chat", dict) plgs = data.get(receiver) plgs.remove(name) data[receiver] = plgs generic_cfg(data, "update", dict, field="disabled_plugins_on_chat") print("Enabled plugin {} in chat {} and saved".format(name, receiver)) cfg["disabled_plugins_on_chat"] = data utils.save_cfg_settings(cfg) return "Plugin {} enabled in the chat again! {}".format(name, utils.emojis["smile"])
def enable_plugin_chat(name, receiver): if not utils.plugin_exists(name): return 'Plugin {} does not exists'.format(name) if not utils.is_plugin_disabled_on_chat(name, receiver): return 'Plugin {} is not disabled in this chat'.format(name) cfg, data = getOrElse('disabled_plugins_on_chat', dict) plgs = data.get(receiver) plgs.remove(name) data[receiver] = plgs generic_cfg(data, 'update', dict, field='disabled_plugins_on_chat') print("Enabled plugin {} in chat {} and saved".format(name, receiver)) cfg['disabled_plugins_on_chat'] = data utils.save_cfg_settings(cfg) return "Plugin {} enabled in the chat again! {}".format( name, utils.emojis['smile'])