Giter Club home page Giter Club logo

node-sparkbot's Issues

misinterpretation of bot commands sent from iPhone Spark clients

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.

Bot is responding to its own messages.

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 -
image

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.