Add log level config option

* Log levels can now be set via the command line and the configuration
  file.
* ServerConfig.load() function takes a file-like object now, rather than
  a string

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2022-06-03 17:21:20 -07:00
parent 418a69c263
commit a823871039
3 changed files with 39 additions and 12 deletions

View File

@@ -23,7 +23,8 @@ async def main():
channel = sys.argv[1]
files = sys.argv[2:]
server_config = ServerConfig()
server_config.load("config.toml")
with open("config.toml") as fp:
server_config.load(fp)
# This only works on one plugin per config
bot = Bot(server_config)
plugin = [plugin for plugin in bot.plugins if isinstance(plugin, Markov)][0]