-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multi-account support #4
Conversation
nameko_slack/rtm.py
Outdated
self._client.server.rtm_connect() | ||
def connect(self): | ||
for bot_name, client in self.clients.items(): | ||
client.server.rtm_connect() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe move within start loop?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, no need for extra method .)
nameko_slack/rtm.py
Outdated
def handle(self, bot_name, event): | ||
for provider in self._providers: | ||
if provider.bot_name == bot_name: | ||
provider.handle_event(event) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might be nice later to have stashed the handlers per bot-name (so we don't need to loop)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right, this uses the ProviderCollector providers set, which the mixin takes care of. It's a trade of between simplicity and efficiency. This could be revisited later on, with making the providers a dictionary.
👍 nice |
Ads the ability to run multiple RTM bots - each bot account having its own RTM client loop