mmpy_bot
mmpy_bot copied to clipboard
LOG_LEVEL never gets set and blocks bot from initiating
Describe the bug I cannot set the LOG_LEVEL setting and mmpy_bot will not initiate. I have tried 2.2.0 and the latest master branch.
How To Reproduce This is the code I used to create the bot
def run_mattermost_bot(app, plugins):
"""Initialize and run the Mattermost bot with specified plugins."""
bot = Bot(
settings=Settings(
MATTERMOST_URL=app.config.get("MATTERMOST_API_URL"),
MATTERMOST_PORT=443,
BOT_TOKEN=app.config.get("MATTERMOST_BOT_TOKEN"),
BOT_TEAM=app.config.get("MATTERMOST_TEAM"),
SSL_VERIFY=True,
LOG_LEVEL=logging.INFO,
),
plugins=plugins,
)
bot.run()
If I want to workaround this, I can add the following check inside mmpy_bot/settings.py (line ~ 124)
elif f.type in [int, float, str]: # type: ignore
if f.name == "LOG_LEVEL":
value = logging.getLevelName(value)
value = f.type(value)
Expected behavior I expect the bot to boot up/initiate
Operating Environment (please complete the following information):
- 2.2.0
- mattermostdriver/mattermostautodriver Version: 1.3.0
- Mattermost Server Version: 9.11.1
- Python Version: 3.13
- OS: Linux
Additional context This is a flask app.