botkit-starter-slack icon indicating copy to clipboard operation
botkit-starter-slack copied to clipboard

How to keep the bot online?

Open davidvexel opened this issue 7 years ago • 4 comments

Hi guys!

I'm trying to set up this kit to remove https://github.com/mvaragnat/botkit-express-demo from my bot.

Once I cloned, installed dependencies and added my Slack app details, the bot sends me the I am a bot that has just joined your team message when the Oauth was successfully, but it never changes it states to on so I can't send any command. Also, it doesn't run if I don't remove the .data/db folder before running it.

Not sure if I'm doing something wrong or there is any configuration that I'm missing.

Thanks in advance!

davidvexel avatar Feb 02 '18 18:02 davidvexel

This is the last debug message I get

debug: Got response null {"ok":true,"channel":"D52343234","ts":"1234323432343","message":{"type":"message","user":"U23423434","text":"You must now \/invite me to a channel so that I can be of use!","bot_id":"B5ACE7CH1","ts":"1234323432343"}}

davidvexel avatar Feb 02 '18 18:02 davidvexel

@davidvexel you should use the much more modern starting point in botkit-starter-slack!

https://github.com/howdyai/botkit-starter-slack

OR, do:

npm install -g botkit
botkit new --platform slack

benbrown avatar Feb 02 '18 22:02 benbrown

Wait, duh, I misread your message! Apologies.

The online status (the green dot next to username) for bots that use Slack's "events API" is controlled inside the api.slack.com site, under teh bot user section. Look for the option that says "always appear online."

Regardless, if properly configured with events API, you should be able to send and receive messages with the bot whether it appears online or not.

benbrown avatar Feb 02 '18 22:02 benbrown

Hi @benbrown,

Yeah the app config in Slack looks good, it works fine if I use the same app with a different project, I guess could be something in the code...

But I'll try this first

npm install -g botkit
botkit new --platform slack

Thank you!

davidvexel avatar Feb 03 '18 00:02 davidvexel