noobot / SlackConnector

A simple to use connector/client for the Slack API in C#
http://github.com/noobot
MIT License
73 stars 44 forks source link

Receive and Download Files/Attachments #77

Closed Workshop2 closed 6 years ago

Workshop2 commented 6 years ago

Resolves #9

SlackMessage now contains a File property, containing all the meta information about any uploaded file.

To download an attachment/file, once you have the Uri simply use the following method:

var uri = new Uri("https://files.slack.com/files-pri/some/file.png");
var download = await slackConnection.DownloadFile(uri);
aabiryukov commented 6 years ago

When you deserializing file data you lose file comment stored in json field: file.initial_comment.comment. It is major metadata for the file message. Please, add file comment into SlackFile.

Thank you.