Giter Club home page Giter Club logo

botkit-zulip's Introduction

BotKit connector for Zulip

In your bot's directory, run:

npm install --save botkit-zulip

Creating a BotKit controller

In the bot JavaScript, to create a Botkit controller use the following lines.

var Botkit = require('botkit');
var controller = require('botkit-zulip')(Botkit, {});

Setup

On your Zulip setting page, create a Generic bot account. Note its email and API key. The bot will only listen to streams it is subscribed to.

When controller.spawn() is called it uses the following environment variables are used to configure the bot.

Alternatively, you can explicitly specify the configuration programatically, like so:

controller.spawn({
  zulip: {
    username: '[email protected]',
    apiKey: <bot api key>,
    realm: 'https://chat.zulip.org'
  }
});

BotKit Studio integration

To use BotKit studio, obtain a BotKit studio token. See the BotKit Getting Started Guide on how to do this.

Once you have a token, you can set the following environment variable.

  • BOTKIT_STUDIO_TOKEN=<BotKit Studio Token> (optional)

Running the test bot

The testbot is intended for quickly trying out the connector during development. It is not intended as a template for a production bot. It would be preferred to follow the official Botkit Get Started guide and then making the modifications described above in Creating a BotKit controller.

To use the bot, create a .env file in the project directory with the following contents:

BOTKIT_STUDIO_TOKEN=<BotKit Studio token, optional>
[email protected]
BOTKIT_ZULIP_API_KEY=<bot api key>
BOTKIT_ZULIP_SITE=http://localhost:9991

and then run npm run testbot

If you have BOTKIT_STUDIO_TOKEN set, you will also be able to try the starter BotKit Studio scripts that are available to your account. (e.g. hello, goodbye, tutorial, etc.)

Building the connector

  1. Install nodejs and npm
  2. Clone git repository.
  3. Run npm install.
  4. Run npm run build.

botkit-zulip's People

Contributors

leomchan avatar

Stargazers

Alex Worrad-Andrews avatar

Watchers

 avatar

Forkers

showell kyary

botkit-zulip's Issues

Fail hard if first attempt to connect fails

From Steve Howell:

I also think we should have the library fail hard if the first attempt to connect fails, as that's almost always a doomed configuration.

This is a good idea.

Feedback: Botkit channel

BotKit has a slack workspace at dev4slack.slack.com

I posted a question about using botkit over Zulip and mentioned this npm package and they didn't know about it. It might be worth approaching them and getting a dedicated channel over there or at least making sure the botkit folks know about this package

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.