scrapinghub / slackbot

A chat bot for Slack (https://slack.com).
MIT License
1.26k stars 394 forks source link

Use arguments when running bot #186

Open soskek opened 5 years ago

soskek commented 5 years ago

Hi,

can we give some parameters to a bot when running? It is useful for easy switching of parameters in the bot.

For example, what I want is like the below (I know this doesn't work)

bot = Bot()
bot.run(port=23456, emotion="angry", max_timeout=10)
bsima commented 5 years ago

This would be the correct way to handle configuration. Currently, the slackbot_settings module is hardcoded to load dynamically, but if you have a build system that puts things in non-standard places (as I do) then this will break.

In fact I'm currently patching the slackbot.settings module to load slackbot_settings from our namespace (our build system prefixes modules with the company name, like Company.Project.slackbot_settings).