ciscodevnet / node-sparkbot Goto Github PK
View Code? Open in Web Editor NEWBuild Webex ChatBots in JavaScript
Home Page: https://developer.webex.com/bots.html
License: MIT License
Build Webex ChatBots in JavaScript
Home Page: https://developer.webex.com/bots.html
License: MIT License
Announced at CLUS 2019, Webex API will support Cards
from Jan Neuzil
"I am currently developping a bot and I have encountered a problem, when you mention the bot from the mobile devices like iPhone, iPad. When you post the message to bot from PC, in the html you have e.g.- html:
'<p><spark-mention data-object-type="person" data-object-id="Y2lzY29xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx">SampleBotName</spark-mention> /help</p>'
but when mentioning from mobile device in the html is:
'<spark-mention data-object-id="349xxxxx-xxxx-xxxxx-xxxxxxx" data-object-type="person">SampleBotName</spark-mention> /help'
so there is missing base64 coding. So when using node-sparkbot node.js module, it doesn't fulfill one condition which would remove HTML tag in html parser function resulting in misinterpretation of bot commands. Is this an intended behaviour or it should be the same? Thank you very much.
I am implementing a cisco spark bot , which is now known as Webex teams. I am able to send receive simple text message from user. Is there a way to send rich card to user from Bot? I could not find any helpful documentation.
Here is my code I use to interact with bot
var SparkBot = require("node-sparkbot");
var SparkAPIWrapper = require("node-sparkclient");
// Starts your Webhook with default configuration where the SPARK API access
token is read from the SPARK_TOKEN env variable
var bot = new SparkBot();
var spark = new SparkAPIWrapper(process.env.SPARK_TOKEN);
bot.onMessage(function (trigger, message) {
if (message.personEmail != "[email protected]")
spark.createMessage(message.roomId, "You said " + message.text, {
"markdown":
true }, function (err, message) {
if (err) {
console.log("WARNING: could not post message to room: " +
message.roomId);
return;
}
});
});
I need to put an extra check to the bot's email with the trigger email to filter out messages from itself.
else it goes in the loop and floods the room with circular messages as -
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.