1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-29 16:43:09 +03:00

Send sticker message in to a room.

This commit is contained in:
Richard Lewis
2018-01-04 21:55:20 +00:00
parent 0238ecebed
commit d44d63c1d6

View File

@@ -1317,6 +1317,31 @@ MatrixClient.prototype.sendImageMessage = function(roomId, url, info, text, call
return this.sendMessage(roomId, content, callback);
};
/**
* @param {string} roomId
* @param {string} url
* @param {Object} info
* @param {string} text
* @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response.
*/
MatrixClient.prototype.sendStickerMessage = function(roomId, url, info, text, callback) {
if (utils.isFunction(text)) {
callback = text; text = undefined;
}
if (!text) {
text = "Sticker";
}
const content = {
msgtype: "m.sticker",
url: url,
info: info,
body: text,
};
return this.sendMessage(roomId, content, callback);
};
/**
* @param {string} roomId
* @param {string} body