Config refactor. Plugins now using config
This commit is contained in:
@@ -60,11 +60,9 @@ creds = botlib.Creds(MATRIX_URL, MATRIX_USER, MATRIX_PASS)
|
||||
config = FunguyConfig()
|
||||
bot = botlib.Bot(creds, config)
|
||||
|
||||
PREFIX = config.prefix
|
||||
|
||||
@bot.listener.on_message_event
|
||||
async def handle_commands(room, message):
|
||||
match = botlib.MessageMatch(room, message, bot, PREFIX)
|
||||
match = botlib.MessageMatch(room, message, bot, config.prefix)
|
||||
if match.is_not_from_this_bot() and match.prefix() and match.command("reload"):
|
||||
if str(message.sender) == config.admin_user:
|
||||
reload_plugins()
|
||||
@@ -73,7 +71,7 @@ async def handle_commands(room, message):
|
||||
await bot.api.send_text_message(room.room_id, "You are not authorized to reload plugins.")
|
||||
|
||||
for plugin_name, plugin_module in PLUGINS.items():
|
||||
await plugin_module.handle_command(room, message, bot, PREFIX, config)
|
||||
await plugin_module.handle_command(room, message, bot, config.prefix, config)
|
||||
|
||||
|
||||
if match.is_not_from_this_bot() and match.prefix() and match.command("rehash"):
|
||||
|
Reference in New Issue
Block a user