Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

Slack.RtmClient is not a constructor #8

Open
BamaJoe411 opened this issue Jul 15, 2020 · 4 comments · May be fixed by #9
Open

Slack.RtmClient is not a constructor #8

BamaJoe411 opened this issue Jul 15, 2020 · 4 comments · May be fixed by #9

Comments

@BamaJoe411
Copy link

admin@vps208087:~/slack-discord-bridge$ node bot.js
/home/admin/slack-discord-bridge/bot.js:8
var slackRTM = new Slack.RtmClient(slackKey.bot_token);
^

TypeError: Slack.RtmClient is not a constructor
at Object. (/home/admin/slack-discord-bridge/bot.js:8:16)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)

@LukeMoll
Copy link
Member

Someone can have a look at this, but I suspect it's because Slack deprecated the RTM API. What version of @slack/client are you running? It might have been introduced by this commit.

I'm not sure whether the RTM API is deprecated or disabled, if it's the former then we can pin a version of @slack/client that still has the constructor.

Regardless, this bridge is being slowly phased out in favour of a unified bridge that will replace this and slack-irc, so this won't be an issue for long.

Thanks for bringing this up!

@BamaJoe411
Copy link
Author

├─┬ @slack/[email protected]
│ ├─┬ @slack/[email protected]
│ │ └── @types/[email protected]

@BamaJoe411
Copy link
Author

BamaJoe411 commented Jul 15, 2020

No problem. I just need a bridge from discord to slack and vice versa. Thought I would give this a try but ran into this issue.
A friend helped me and found the issue was the case.
RTMClient: { [Function: RTMClient] loggerName: 'RTMClient' },
RTMClient not RtmClient
Fixing that lead to more errors and I'm not familiar with node enough to continue fixing it.

@LucasAschenbach LucasAschenbach linked a pull request Jan 28, 2023 that will close this issue
@LucasAschenbach
Copy link

Just created a PR, migrating the slack bot to the new Events API which fixes this issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants