Giter Club home page Giter Club logo

node-sparkclient's People

Contributors

geekbleek avatar marchfederico avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

node-sparkclient's Issues

html message example

I am unable to find how to send a html message using

client.createMessage(trigger.data.roomId, 'Hi, I am the Hello World bot!', { "html":true }, function(err, message) {
if (err) {
console.log("WARNING: could not post message to room: " + command.message.roomId);
return;
}
});

in this case hello becomes bold but world does not become red.

Sending an attachment with a message

Goal: Send an attachment via a relative path

I have successfully attached a file to a create message request using the documented mechanism (http://site/file). I'm looking to do this with a relate file path (or even absolute within the site structure). Attempting to do so always results in an error (Unable to retrieve content.). Placing code to read the file just prior to sending the message successfully returns the contents of the file. I've tried with both "file" and "files" in an attempt to get this to work. I've also tried true relative and absolute paths using the file system structure.

Thoughts?

var readmePath = path.join(__dirname, 'README.md');
fs.readFile(readmePath, function(err, data) {
    if (err)
        console.log(err);
    console.log(data);
});
console.log(readmePath);
var messageParams = {};
messageParams.file = readmePath;
messageParams.markdown = true;

spark.createMessage(command.message.roomId, "Here is the document you requested.", messageParams, function(err, message) {
    if (err) {
        console.log("WARNING: could not post attachment to room: " + command.message.roomId);
        console.log(err);
        return;
    }
});

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.