Handle missing optional variables

This commit is contained in:
2021-01-12 22:04:29 +01:00
parent 4f6f102d1e
commit f909d43c59
3 changed files with 7 additions and 3 deletions

View File

@ -1,5 +1,9 @@
# xbotlib x.x.x (UNRELEASED)
# xbotlib 0.3.2 (2021-01-12)
- Fix config parser environment loading for missing optional variables
# xbotlib 0.3.1 (2021-01-12)
- Support `--no-input` flag and read configuration from the environment

View File

@ -4,7 +4,7 @@ build-backend = "poetry.masonry.api"
[tool.poetry]
name = "xbotlib"
version = "0.3.1"
version = "0.3.2"
description = "XMPP bots for humans"
authors = ["decentral1se <lukewm@riseup.net>"]
maintainers = ["decentral1se <lukewm@riseup.net>"]

View File

@ -101,8 +101,8 @@ class Bot(ClientXMPP):
self.config["bot"] = {}
self.config["bot"]["jid"] = environ.get("XBOT_JID")
self.config["bot"]["password"] = environ.get("XBOT_PASSWORD")
self.config["bot"]["room"] = environ.get("XBOT_ROOM")
self.config["bot"]["nick"] = environ.get("XBOT_NICK")
self.config["bot"]["room"] = environ.get("XBOT_ROOM", "")
self.config["bot"]["nick"] = environ.get("XBOT_NICK", "")
def init_bot(self):
"""Initialise bot with connection details."""