Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

slackbot example update to reflect package and api changes #879

Closed
wants to merge 4 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use linter
Ran the linter on the sample with `npm run lin -- --fix`.
  • Loading branch information
fhinkel committed Nov 12, 2018
commit 1547a0237382d4fbe1d1d630e12709985fc25551
5 changes: 2 additions & 3 deletions language/slackbot/demo_bot.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ See the README.md in this directory for more information about setup and usage.

'use strict';

const Botkit = require('botkit');
const Slackbot = require('botkit').slackbot;
const fs = require('fs');
const language = require('@google-cloud/language');
const path = require('path');
Expand All @@ -54,7 +54,7 @@ if (!process.env.SLACK_TOKEN_PATH) {

var token = fs.readFileSync(process.env.SLACK_TOKEN_PATH, { encoding: 'utf8' });
token = token.replace(/\s/g, '');
const controller = new Botkit.slackbot({clientSigningSecret: token});
const controller = new Slackbot({clientSigningSecret: token});

// create our database if it does not already exist.
const db = new sqlite3.cached.Database(path.join(__dirname, './slackDB.db'));
Expand Down Expand Up @@ -86,7 +86,6 @@ const TABLE_SQL = `CREATE TABLE if not exists entities (
);`;

function startController () {

// Create the table that will store entity information if it does not already
// exist.
db.run(TABLE_SQL);
Expand Down