sending attachments / images?
See original GitHub issuethe demo examples here just send a text response, vis:
+ response = text.split('').reverse().join('');
+ channel.send(response);
+ console.log('@%s responded with "%s"', slack.self.name, response);
can this node package be used to send other types of messages, or attachments?
I’ve tried sending JSON like:
if (reply) {
// channel.send(reply.string);
msgpack = {
type: "message",
text: reply.string,
icon_url: "http://laorquesta.mx/wp-content/uploads/2014/12/bikers-300x225.jpg",
attachment: {
"color": "#36a64f",
"title": "drifter bot",
"title_link": "http://superscriptjs.com/starter/quickstart"
}
}
// channel.send(JSON.stringify(msgpack))
channel.send(msgpack)
but just get an error back:
{ code: 2, msg: 'message text is missing' }
Issue Analytics
- State:
- Created 9 years ago
- Comments:12 (3 by maintainers)
Top Results From Across the Web
How to Send an Attachment or Photo Through E-mail
This page contains information on how to attach a photo, picture, document, PDF, and other files in popular programs and services.
Read more >Add pictures or attach files in Outlook.com
You can attach photos and documents from your computer or OneDrive to email messages and calendar events. Attachments always appear at the top...
Read more >How To Send A Photo As An Email Attachment On Windows ...
Fill out the email form as you normally would then click 'insert' found at the top of the window to add an image...
Read more >Send attachments with your Gmail message - Android
Add attachments, like files or photos, to your emails. To send large files over the size limit, like videos, use Google Drive. Android...
Read more >Send a photo or attachment with a message - Twist
While writing a message, tap the photo icon. You now have three options: Choose one or several of the photos available in the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I found out, what the problem was / is. You NEED to JSON encode the ‘attachments’ argument, so the ‘attachments’ is actually a string and not an object. Then it should work. At least for me that worked.
The
>= 2.0.0
release will now check this for you, so should be a little easier to use, you can see where it’s doing that here