slack
slack copied to clipboard
Using slack-go for new slack app
I have been trying to follow the examples but have been unsuccessful to get it to authenticate properly. It is returning an error related to RTM and that would be the classic bot OAuth from my understanding.
Does this library support the use of tokens for new slack apps instead of classic? If so could someone direct me to an example?
Hey, did you succeed doing so? I'm currently trying to learn go on a useful project, and a small slack bot sounded useful, but this is really a show-stopper currently for me. Would be <3 to get some pointers (alternative projects are also fine)...
It will work for me using the Slack classic tokens but I haven't gotten it to working using the bot token for the new Slack API.
On Sat, Nov 7, 2020 at 11:02 AM Lena Brüder [email protected] wrote:
Hey, did you succeed doing so? I'm currently trying to learn go on a useful project, and a small slack bot sounded useful, but this is really a show-stopper currently for me. Would be <3 to get some pointers (alternative projects are also fine)...
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/slack-go/slack/issues/827#issuecomment-723482201, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAM6LR4QM3X6JZUH2UIBM3TSOWKUPANCNFSM4SSNGTNA .
Could you share reproducible code?
I fell back to also using the classic tokens, which I think are only available if you add some query parameter to the URL where you need to set the credentials up for your app in slack (I don't remember exactly, but it was along the lines of "token=classic" or "classic=true"). When you have one of those, the code from the repo works well.
Still can't use the slack-go with the new slack token, It gives not_allowed_token_type
error.
Only 2 options remain, use Events API or create a classic slack app token. Any 3rd option?
@kunal15145. If you only need a bot and don't what to bother with the slack app configuration. Use https://slack.com/apps/A0F7YS25R-bots, this will add a bot in your workplace and provide you with the token for that bot (xoxb-...). I use that solution when I want to test things out, I hope it helps in your case.
Faced the same issue today, almost in the end of 2021! A brand new slack app, app and bot token for websocket connection:
slackApi := slack.New(conf.Slack.BotToken, slack.OptionAppLevelToken(conf.Slack.AppToken), slack.OptionDebug(conf.Slack.Debug))
slackRtm := slackApi.NewRTM()
go slackRtm.ManageConnection()
and Failed to start or connect to RTM: not_allowed_token_type
as a result. Seems that modern slack bots can not be connected to Slack via websocket.
Not sure if this a related, but thought I'd link in case this is useful. #941
This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.
This issue was closed because it has been stalled for 10 days with no activity.