-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Cannot read property 'user_id' when dealing with Slack Apps. #590
Comments
It looks like it may be a configuration issue after all. I was able to get it to work once I also allowed "bot" during the oauth "Slack Button" creation, but I wasn't using a bot for anything in my scripts, just slash commands. I'm not sure if there is any advise on how to set it up if you don't need a bot? Maybe I'm configuring the code improperly to handle a no bot situation. |
Had the same issue. After allowing a bot, I'm getting the error:
Using Should I be spawning a bot? If so, how would I get the bot token if it's an app's bot? EDIT: Downgraded to 0.4.2, no longer getting the error. |
Hey @peterswimm - over here we ran into the same issue. I think this may be due to some of the changes that Slack has made recently. Since by default, if you enable slash command on your slack app (without a bot user) - you do not ask for the 'bot' permission. And now with the latest Slack change, you cannot add bot permission without a bot user. It should still be possible to use slash commands without asking for the bot oauth permission (and subsequently adding a bot user) - as slash commands are independent from bot users. The call to set the user_id of the bot object (which doesn't exist, because we don't have bot oauth permission, see line 5) is here : https://github.com/howdyai/botkit/blob/master/lib/SlackBot.js#L209 Just wanted you to be aware of this. We are looking at the feasibility of submitting a PR for you guys; I think it may be relatively easy to fix. |
@peterswimm The latest version has moved braces and the functionallity is broken again In the original PR the if was closed here https://github.com/howdyai/botkit/pull/699/files#diff-ffa8ec227ea6e9babdfc11d5a71ee29dR223 While currently it's closed before getting bot id making the problem reappear: https://github.com/howdyai/botkit/blob/master/lib/SlackBot.js#L217 |
i've the same issue with the latest version (0.6.7)
|
any updates of the issue? still not resolved in the latest version(0.6.9) |
I'm also facing this issue after following the basic slash commands set-up. Any suggested workaround at this time? |
I've been having the same issue when trying to initiate a dialog, I issued a PR #1281 with changes according to #590 (comment) This is quite important for us, we could not find a npm version that implements dialogs on Slack that does not have this issue. |
This still hasn't been merged? I can't seem to get Slash commands working because of this. |
Also seeing this issue; verified #1281 is fixing this for me as well. Do we have an ETA on getting that PR reviewed/merged? |
Hotfix for issue howdyai#590
Work around - We are using another workaround from here #108 const controller = Botkit.slackbot({
disable_startup_messages: true,
json_file_store: 'tmp/slack.json'
});
// FIX for: https://github.com/howdyai/botkit/issues/108
var bot = controller.spawn({
token: SLACK_TOKEN
});
bot.api.team.info({}, function(err, response) {
if (err) throw new Error(err.stack || JSON.stringify(err));
// FIX2 this is a workaround for https://github.com/howdyai/botkit/issues/590
response.team.bot = {
id: 'boti',
name: 'boti'
};
// END FIX2
controller.saveTeam(response.team, function() {
// ignore
})
});
// END FIX |
I'm getting this issue and after trying @mrbar42's fix, I'm getting this error:
Why is this issue closed? Is that fix supposed to be the right way to get around this |
Is there any fixed for this? Currently encountering this on version |
@justinemar that's a very old botkit, you should upgrade to the latest version and tell us if you are still seeing the trouble |
I am experiencing the same issue again while creating a custom slash command. |
@joanitad Does your Slack application have a bot associated with it? Adding one should resolve this. |
@benbrown : I have a bot user setup. Is that what you mean? if not, how do I know if the slack application has a bot associated with it? |
Hi @benbrown , could you clarify this, I have a bot user associated with the application and the bot is added to #general.I still get this error. |
When attempting to configure a private Slack App, I'm running into issues with
team.bot.user_id
being undefined? Is this a configuration issue with Slack Apps? Theteam
object I get back in that area of code looks like this:I've pasted the error logs below.
I've also added the basic code used for testing.
The text was updated successfully, but these errors were encountered: