-
Notifications
You must be signed in to change notification settings - Fork 160
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
New user can't execute bot command #74
Comments
ooh good catch, I hadn't considered that case! Thanks so much for reporting, fixing it will be a top priority when I get time to work on this. |
I'd encountered this before but wasn't sire what caused it. I knew a A similar issue happens when you add the bot to a new private group on the Mind if I have a go at fixing this? On Sat, 30 Apr 2016 02:20 Bill Mill notifications@github.com wrote:
|
Not at all, have at it |
Looking at the offending code, it appears to be because slackrtm pulls the list of users originally and as such the server object has a static list of users in When a new user enters, slackrtm doesn't update the list of users, which is giving the key error. The immediately obvious way to fix it would be to make slackrtm update the users first when this KeyError occurs, try again and then if it happens again perform the debugging. Having said that, what purpose does this line serve? (from
Can this be replaced with just |
Yup! So I think one part of fixing this is updating slackrtm to catch the
Very good question! It used to be there to make sure that we didn't get into a loop by responding to bot messages from ourself or from slackbot. However, slack has since added the It also relates to issue #40, which was the cause of me starting to check that every message has a user.
I think this is the correct answer! We no longer need to check that the user is in the slackrtm roster, though we should fix that too because plugins could depend on that behavior. |
As
I'll make the PR soon. |
Ok, I deviated a bit and kept some of the code closer to what it was, and I've made slackrtm update at the same time as fixing this issue (and another issue) |
Right now, new users are crashing limbo because they don't get added to the user roster. See: llimllib/limbo#74 This commit fixes that issue, as well as moves the _pytest dir to tests and adds tests for group join and team join. closes #2
Fixed in 6be28e4 |
The bot is running and then a new user is being added to the team. When the new user is trying to execute the bot command he/she will trigger the KeyError because
server.slack.server.users
hasn't been updated when the user got added. -> https://github.com/llimllib/limbo/blob/master/limbo/limbo.py#L131The text was updated successfully, but these errors were encountered: