xoxco / node-slack Goto Github PK
View Code? Open in Web Editor NEWa nodejs module for sending and receiving messages from Slack
License: MIT License
a nodejs module for sending and receiving messages from Slack
License: MIT License
I have developed a MeteorJs project which sends some messages on your Slack.
Though it runs smoothly locally and on Heroku, when I uploaded on DigitalOcean I am getting this message:
"[Log] Error invoking Method 'sendSlack': Internal server error [500] (f28e39f50692cf61ad0b0a98bfb0e69f709b7d17.js, line 3)"
Any idea why I am getting this?
The Slack API seems to support mrkdwn
and mrkdwn_in
as options as stated here: https://api.slack.com/docs/formatting
Would be great if those options were supported. (Unless I'm missing something here)
They changed their webhooks API sometime around the 5th of October so this module no longer works.
Slack allows you to set the channel for an incoming webhook request, but because this module defaults to #general if no channel is passed to send(), the default always gets overridden with #general
I am able to post messages through your repo but I continue to get the below message on both my local and staging environments
XMLHttpRequest cannot load https://hooks.slack.com/services/randomtext/randomtext.
A wildcard '*' cannot be used in the 'Access-Control-Allow-Origin' header when the credentials flag is true.
Origin 'https://localhost:3000' is therefore not allowed access.
Slack doesn't have outgoing webhook now.
I'm getting this warning:
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
From my investigation, it is coming from node-slack
"node-slack": {
"version": "0.0.7",
"resolved": "https://registry.npmjs.org/node-slack/-/node-slack-0.0.7.tgz",
"integrity": "sha512-LsjUmymJcwF7P2Z3wImZRYIZvh068aQNYK6/FW+24fred4+hWPHyc6L9f7nQUoA6myt6NPFDBPXSqe493+cXqQ==",
"requires": {
"deferred": "0.7.1",
"request": "~2.x"
}
},
Link: request/request#3142
I tried to send icon with slack message but i can't get it done.
As the readme shows, I tried the following:
slack.send({
text: `${environment} - ${finalMessage}`,
channel: `#${channel}`,
username: 'Bot',
icon_emoji: ':taco:',
});
May I have to put :taco:
in the message body? If i do that it works but then why i have to use 'icon_emoji' property?
Thank you in advance.
The latest changes haven't been published to NPM yet
> [email protected] prepublish c:\Users\WesM\AppData\Local\Temp\npm-9848-gU1fR6N1\bluebird-2.9.341440627724324-0.9726775458548218\package
> node tools/build.js --no-debug --main --zalgo --browser --minify
module.js:333
throw err;
^
Error: Cannot find module 'c:\Users\WesM\AppData\Local\Temp\npm-9848-gU1fR6N1\bluebird-2.9.341440627724324-0.9726775458548218\package\tools\build.js'
at Function.Module._resolveFilename (module.js:331:15)
at Function.Module._load (module.js:273:25)
at Function.Module.runMain (module.js:490:10)
at startup (node.js:123:16)
at node.js:1027:3
Just taking a look at this package for the first time, looks like we aren't able to send slash command, am I missing something or is this not available in this package?
Great little lib, I however fail to send multiline messages.
Setting text to something like "First line\nSecond line" comes out in Slack as "First line/nSecond line"
Looks like there is a mapping from \ to / somewhere... Couldn't find it though - prob missed something obvious..
This is a valid usage to send with only attachments and no text.
Line 13 of slack.js should be
if (!message.text && !Array.isArray(message.attachments)) {
I need to disable unfurling, but when I use option unfurl_media: false
, the image is still shown.
This code reproduces it:
var Slack = require('node-slack');
var config = {
hook: 'https://hooks.slack.com/services/<token>',
channel: '#<channel>',
};
var slack = new Slack(config.hook);
slack.send({
text: 'This message should not display image https://d3blmjzegggclu.cloudfront.net/assets/images/front/camera-big.png?1439887878, but image is shown.',
username: 'TEST',
channel: config.channel,
unfurl_links: false,
unfurl_media: false,
});
Result:
I only found out that there's a callback associated to send
because of an unaccepted PR to make send
promisified. Any docs around the promises or callbacks would really help new users.
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.