Add sending local bot messages
This commit is contained in:
parent
c294df6b26
commit
5a6fb990c7
|
@ -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.
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue