Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/CiscoDevNet/node-sparkbot-samples
Chatbot samples leveraging the node-sparkbot library for Webex Teams
https://github.com/CiscoDevNet/node-sparkbot-samples
chatbot webex-teams
Last synced: 3 months ago
JSON representation
Chatbot samples leveraging the node-sparkbot library for Webex Teams
- Host: GitHub
- URL: https://github.com/CiscoDevNet/node-sparkbot-samples
- Owner: CiscoDevNet
- License: mit
- Created: 2016-10-24T12:34:22.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2022-12-10T16:24:46.000Z (about 2 years ago)
- Last Synced: 2024-11-16T07:30:44.148Z (3 months ago)
- Topics: chatbot, webex-teams
- Language: JavaScript
- Homepage: https://github.com/CiscoDevNet/node-sparkbot
- Size: 859 KB
- Stars: 21
- Watchers: 16
- Forks: 28
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-webex - sparkbot-samples - Examples of bots, leveraging the node-sparkbot framework (by ObjectIsAdvantag). (Code samples / Bot samples)
README
# 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](https://learninglabs.cisco.com/tracks/collab-cloud/spark-apps/collab-spark-botl-ngrok/step/1).Then, pick a [template](templates/) that suits your scenario, and customize it.
Note that these bot samples leverage the [node-sparkbot](https://github.com/CiscoDevNet/node-sparkbot) Chatbot framework.
__Also, if you're new to Webex Teams API, note that DevNet provides a full learning track: [Learning track](https://learninglabs.cisco.com/tracks/collab-cloud).__
## [inspect](examples/inspector.js)
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 APIThis bot can be run as is with either a Developer or a Bot access token
Invite [email protected]_ to meet the bot.
![](docs/img/bot-inspect-welcome.png)
## [roomId](examples/roomid-phantom.js)
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 TeamsInvite [email protected]_ to meet the bot.
![](docs/img/bot-roomId.png)
## [room-stats](examples/room-stats.js)
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 APINote 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.
![](docs/img/bot-room-stats.png)
## [events](examples/devnet/bot.js)
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 APIInvite [email protected]_ to meet the bot.
![](docs/img/bot-ciscodevnet-next.png)
## [helloworld](examples/helloworld.js)
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 APIThis bot can be run as is with either a Developer or a Bot access token
![](docs/img/bot-helloworld.png)