Giter Club home page Giter Club logo

node-sparkbot-samples's Introduction

Webex Teams Chatbot examples in Node.js

Interested in creating your own Webex Teams Chatbots ? Go through the examples below.

If you feel inspired, run your own version of these bots. Simply take the step-by-step tutorials at DevNet: Run a Webex Teams bot locally.

Then, pick a template that suits your scenario, and customize it.

Note that these bot samples leverage the node-sparkbot Chatbot framework.

Also, if you're new to Webex Teams API, note that DevNet provides a full learning track: Learning track.

Provides instant access to Webex Teams technical data (such as the space id, or the email of a space participant).

Features illustrated by this example:

  • Help command to display available commands
  • About command to get meta info about the bot
  • Welcome message as the bot is added in a room
  • Fallback message if a command is not recognized
  • Uses the "node-sparky" library to requests the Webex Teams API

This bot can be run as is with either a Developer or a Bot access token

Invite [email protected] to meet the bot.

Fetches the identifier of the space in which this bot has just been added, pushes the roomId via a direct message, and leaves the inquired space right away.

Features illustrated by this example:

  • Help command to display available commands
  • About command to get meta info about the bot
  • Fallback message if a command is not recognized
  • Send a direct message and leaves the room
  • Uses "node-sparky" library to interact with Webex Teams

Invite [email protected] to meet the bot.

Computes stats for the space it is invoked from.

Features illustrated by this example:

  • Help message to display bot commands
  • Welcome message as the bot is added in a room
  • Custom command prefix #
  • Markdown formatting with lists & mentions
  • Runs with a Developer account
  • Uses "node-sparky" library to invoke the Webex Teams API

Note that this webhook must be run with a personal access token (from a fake Webex Teams account), because the bot must be able to fetch all messages from spaces, not only those for which bot is mentionned.

Invite [email protected] to meet the bot.

Tells you about upcoming DevNet events.

Features illustrated by this example:

  • Help command to display available commands
  • About command to get meta info about the bot
  • Welcome message as the bot is added in a room
  • Fallback message if a command is not recognized
  • Command with integer argument
  • Markdown formatting with lists and hyperlinks
  • Uses "node-sparky" library to wrap calls to the Webex Teams REST API

Invite [email protected] to meet the bot.

A simple template to start from.

Features illustrated by this example:

  • Welcome message as the bot is added in a room
  • Help command to display available commands
  • Fallback message if a command is not recognized
  • Markdown formatting
  • Leverages the "node-sparkclient" library to wrap calls to the Webex Teams REST API

This bot can be run as is with either a Developer or a Bot access token

node-sparkbot-samples's People

Contributors

dependabot[bot] avatar dstaudt avatar objectisadvantag avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-sparkbot-samples's Issues

RoomId bot: include the Room title

"I find myself putting it bak into several rooms to re-generate the RoomId when I need it… but if the title was included in the message I could just scroll back up through the history…"

Minor spelling error

When localhost:8080 is opened I get "Congrats, your Cisco Spark bot is up and running". On cmd, there is a minor spelling error. It says, sparkbot healtch check hitted +22s.

Unexpected Identifier

I followed the instructions on DevNet and I get error below when I try to run it.
I have the latest node installed.
I have git installed
I am not using an node.js IDE.

set DEBUG=sparkbot*,samples*
set ACCESS_TOKEN={mytoken} // yes I used my real token
node examples\helloworld.js

let email = command.message.personEmail; // User that created the message
^^^^^
SyntaxError: Unexpected identifier
at exports.runInThisContext (vm.js:73:16)
at Module._compile (module.js:443:25)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.Module.runMain (module.js:501:10)
at startup (node.js:129:16)
at node.js:814:3

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.