Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion lib/mvc/Scope.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class Scope {

this._isEditedMessage = update.editedMessage ? true : false

this._message = update.message || update.editedMessage
this._message = update.message || update.editedMessage || update.channelPost
this._chatId = this._message.chat.id
this._userId = this._message.from.id
this._fromGroupChat = !(this._userId === this._chatId)
Expand Down Expand Up @@ -96,6 +96,14 @@ class Scope {
get chatId() {
return this._chatId
}

/**
*
* @returns {Message}
*/
get channelPost() {
return this._channelPost
}

/**
*
Expand Down
8 changes: 4 additions & 4 deletions lib/updateProcessors/MessageUpdateProcessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ class MessageUpdateProcessor extends BaseUpdateProcessor {
* @param {Update} update
*/
process(update) {
if (update.message || update.editedMessage) {
let message = update.message || update.editedMessage
if (update.message || update.editedMessage || update.channelPost) {
let message = update.message || update.editedMessage || update.channelPost

let scope = new Scope(
update,
Expand Down Expand Up @@ -107,7 +107,7 @@ class MessageUpdateProcessor extends BaseUpdateProcessor {
* @param {Update} update
*/
supports(update) {
return !!(update.message || update.editedMessage || update.callbackQuery)
return !!(update.message || update.editedMessage || update.callbackQuery || update.channelPost)
}

/**
Expand All @@ -127,4 +127,4 @@ class MessageUpdateProcessor extends BaseUpdateProcessor {
}
}

module.exports = MessageUpdateProcessor
module.exports = MessageUpdateProcessor