bot.identity throws on Slack
michaelmior opened this issue · comments
Seems similar to #28 for Facebook. bot.identity
doesn't appear to be mocked so when I try to use it, I get a Slack API auth error because it's trying to use the Slack API with my dummy test credentials.
hey @michaelmior,
i would like to see your example of code how do you use bot.identity
.
Here's a brief example.
module.exports = function(controller) {
controller.hears(['uptime', 'identify yourself', 'who are you', 'what is your name'],
'direct_message,app_mention', function(bot, message) {
var hostname = os.hostname();
bot.reply(message,
':robot_face: I am a bot named <@' + bot.identity.name + ' on ' + hostname + '.');
}
);
};
hey @michaelmior,
sorry for the long response.
what version of botkit do you use?
i checked lates version of botkit (next) it has identity but with bot id only as part of adapter.
I was using botkit 0.70 and this worked. I'm now trying to upgrade to 4.5.0.
oaky, you can check our change log we have 0.7.4 for latest legacy botkit
important notice!
we do not support facebook adapter for botkit (next) yet, i don't have ETA for that
oh i checked our latest facebook mock for legacy it does not support identity.
if you can give me test repo like this for facebook it could speed up implementation of mock
I understand the legacy version works, but I'm currently trying to use botkit 4.5.0. I'm also not using Facebook, but Slack.
@michaelmior have you tried this botkit-mock version?
Let us know if bot.identity
works in that branch. If not, @ihorrusinko and I will look into adding an implementation.
@michaelmior following up here:
- Could you confirm the version of botkit-mock you're using?
- Could you confirm
bot.identity
is working in your code, but not working from the mock?
Sorry for the delayed response. I tried that branch and I get the same behaviour. Unfortunately I haven't had the chance to spin up a test instance to see if it works in production with the new botkit version, but it did work with botkit version 0.7.0
@michaelmior Please spin it up in production and let us know if it works, whenever you get a chance. My colleague, @ihorrusinko , thinks that bot.identity
does not work as expected in the later versions of botkit, which is why you'd get an issue testing it with botkit-mock.
If bot.identity
does work with the later version of botkit you're using, then we will make a task to implement mocking functionality. I'll leave this open until you report back with production results. I appreciate you opening this up and bringing this to our attention.