Comments (6)
You could call the login() method, it should restart an RTM session.
from slack-bot-api.
It usually closes the connection immediately after login. Might there be some limit on number of simultaneous sockets per one user? I do have around 20 bot instances deployed using same credentials.
from slack-bot-api.
If you suspect that sockets are being closed because of how many instances are running, I would suggest to listen for error events on the socket and look if your sockets are being rate limited. According to the API documentation continuing to send request after being rate limited will get your application disconnected.
from slack-bot-api.
They get disconnected even when not rate limited. They really don't talk much - 2-3 messages per hour per instance so total messages are around 40 messages/hour.
From pool of 20 machines about 15 are connected and 5 get disconnected. Machines go down for night and in the morning when they boot up, the situation is similar. Just disconnected machines might not be the same ones.
from slack-bot-api.
Your question is how to reconnect or why connection sometimes closes immediately?
For reconnection you can simply invoke login
method.
Is second problem connected with this issue #20?
from slack-bot-api.
My question as of today is, if anyone knows why sockets get closed, if there are more than 17 instances of same bot user. I think this should be asked from slack team instead :)
Otherwise login method works as expected and thank You both for this.
from slack-bot-api.
Related Issues (20)
- postMessageToUser does not Work HOT 1
- Promise returns undefined
- [Node 12] [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated
- How to prevent the bot auto disconnect? HOT 15
- Sorry if I have asked a stupid question: const EventEmitter = require('events'); vs var EventEmitter = require('events').EventEmitter; HOT 1
- Setting bot's profile image HOT 1
- How to start a thread and send message under that thread?
- Send an image? HOT 1
- Tokens created with Slack’s new granular permissions generate a `not_allowed_token_type` error. HOT 13
- Issue with deploying to cloud foundry HOT 1
- [ERROR] not_allowed_token_type error on new bot app HOT 18
- Can't find a way to identify messages that are '@' the bot. HOT 1
- SyntaxError: Unexpected token < in JSON at position 0 HOT 1
- Error: Uncaught error: ratelimited
- Why appending "+" to every whitespace?
- Facing error in connection of uipath and Slack HOT 4
- Slack rtm.start() deprecation HOT 2
- Slack's update in `connect.start` API breaks the `slackbots` package HOT 1
- The new endpoint `conversations.list` is paginated
- Lib gets only first page of paginated endpoints
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from slack-bot-api.