Comments (6)
Couple things.
- You have to have a Procfile in the root of your git repository targeting
worker: node slack_bot.js
or whatever the path / name is to your start file is (the default is slack_bot.js). Commit to your repository. - Go to your Heroku dashboard and under settings click "revel config vars" and add in a new key:value with the key being "token" and the value being the slack key your were given by slack.
- Go to the resources tab, you should now see your "worker dyno". click the pencil, and slide it to the "on" state. You should see your bot wake up in slack, (if you navigate to a different tab, and then back to the resources tab you will see status "awake").
- if you are using the "uptime" example command from the example in botkit, you can type "uptime" and you should see something like
:bot_face: I am a bot named whatever. I have been running for 2.2119333333333335 minutes on a bunch of letters and numbers.
This means your bot is awake and running
from botkit.
This works! I forgot to add a Procfile which Heroku needs to start up the dyno (free plan) after periods of inactivity. There is just one line of code worker: node bot.js
in that Procfile, but it makes all the difference.
from botkit.
Hi, I'm having similar problems, when I run a simple botkit app on Heroku, I get after 60 seconds "Stopping all processes with SIGTERM" and the app shuts down. Now I know that a node.js server needs a port, and heroku spins them up dynamically, but do you know what I should change to do this?
My script is tiny:
"use strict";
const SLACK_BOT_TOKEN = process.env.SLACK_BOT_TOKEN;
let Botkit = require('botkit'),
formatter = require('./modules/slack-formatter'),
salesforce = require('./modules/salesforce'),
controller = Botkit.slackbot(),
bot = controller.spawn({
token: SLACK_BOT_TOKEN
});
bot.startRTM(err => {
if (err) {
throw new Error('Could not connect to Slack');
}
});
controller.hears(['help'], 'direct_message,direct_mention,mention', (bot, message) => {
bot.reply(message, {
text: `You can ask me things like:
"Search account Acme" or "Search Acme in acccounts"
"Search contact Lisa Smith" or "Search Lisa Smith in contacts"
"Search opportunity Big Deal"
"Create contact"
"Create case"`
});
});
from botkit.
Thanks! It worked really well, though the reddis bit needed some tweaking.
There was a good blog on it with sample code. It's up and running nicely!
On 12 May 2016 at 20:48, Corey Snyder [email protected] wrote:
Couple things.
You have to have a Procfile in the root of your git repository
targeting worker: node slack_bot.js or whatever the path / name is to
your start file is (the default is slack_bot.js). Commit to your repository.
2.Go to your Heroku dashboard and under settings click "revel config
vars" and add in a new key:value with the key being "token" and the value
being the slack key your were given by slack.
3.Go to the resources tab, you should now see your "worker dyno". click
the pencil, and slide it to the "on" state. You should see your bot wake up
in slack, (if you navigate to a different tab, and then back to the
resources tab you will see status "awake").
4.if you are using the "uptime" example command from the example in
botkit, you can type "uptime" and you should see something like :bot_face:
I am a bot named whatever. I have been running for 2.2119333333333335
minutes on a bunch of letters and numbers. This means your bot is
awake and running—
You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#53 (comment)
from botkit.
Great! A tip, I turn off the bot in Heroku by sliding the worker dyno to "off" if you need the bot to go offline to work locally via the terminal or whatever. Also, Heroku will "restart" if you push to production some new code. Finally, the bot will have to "sleep" if you are using the free Heroku account for a few hours in each 24 hour cycle. So upgrade to the hobby account if you need your bot "awake" 24-7.
from botkit.
see https://github.com/Daij-Djan/chatbot_templates for a checklist to deploy to heroku ;)
from botkit.
Related Issues (20)
- botkit 4.15.0 and Webex Adapter 1.0.10 are not on NPM HOT 1
- How to upload this Bot to Teams? HOT 2
- Bot can send, but not receive anymore HOT 2
- Botkit Webex API client not returning data HOT 1
- Question: Handling Websocket terminations HOT 1
- Uncatchable throws on botbuilder-adapter-webex registerWebhookSubscription Functions HOT 19
- Conversation become "duplicated" when running long operation HOT 1
- Help in Implementing the B2C Chatbot
- Webex Teams Adapter Doesn't Support direct_mention Event Type
- ☺
- BotkitConversation not executing when using axios but its executing fine when calling inside request?
- Cannot read property '1' of undefined
- Block Action Issue (when 'Clear Selection' is clicked)
- Can I message a pages followers with this??
- Remove deprecated request package
- Is project Dead? HOT 2
- Botkit
- Server Crash due to Missing Credentials in Slack Adapter
- npm install -g yo generator-botkit HOT 1
- Javascript heap out of memory issue after upgrading botkit from 0.6 to 4.15.0
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 botkit.