Add sendFile function (#562)

* sendFile

* Add default value to filename

* eslint

* (╯°□°)╯︵ ┻━┻
This commit is contained in:
Manuel Kraus
2016-08-29 20:01:05 +02:00
committed by Amish Shah
parent df934eccaf
commit d9ae732bfd
10 changed files with 87 additions and 9 deletions

View File

@@ -41,7 +41,7 @@ class RESTMethods {
});
}
sendMessage($channel, content, tts, nonce) {
sendMessage($channel, content, tts, nonce, file) {
return new Promise((resolve, reject) => {
const $this = this;
let channel = $channel;
@@ -49,7 +49,7 @@ class RESTMethods {
function req() {
$this.rest.makeRequest('post', Constants.Endpoints.channelMessages(channel.id), true, {
content, tts, nonce,
})
}, file)
.then(data => resolve($this.rest.client.actions.MessageCreate.handle(data).m))
.catch(reject);
}