Add sending local bot messages

This commit is contained in:
Samuel Elliott 2018-04-25 13:54:33 +01:00
parent c294df6b26
commit 5a6fb990c7
No known key found for this signature in database
GPG Key ID: 8420C7CDE43DC4D6
1 changed files with 12 additions and 1 deletions

View File

@ -56,7 +56,7 @@ export class Channel {
/**
* Send a message in this channel.
* @param {String} content The message's new content
* @param {String} content The new message's content
* @param {Boolean} parse Whether to parse the message or send it as it is
* @return {Promise}
*/
@ -68,6 +68,17 @@ export class Channel {
return Message.from(Modules.MessageStore.getMessage(this.id, response.body.id));
}
/**
* Send a bot message in this channel that only the current user can see.
* @param {String} content The new message's content
* @return {Message}
*/
sendBotMessage(content) {
const message = Modules.MessageParser.createBotMessage(this.id, content);
Modules.MessageActions.receiveMessage(this.id, message);
return Message.from(Modules.MessageStore.getMessage(this.id, message.id));
}
/**
* A list of messages in this channel.
*/