linkchanbot

Telegram bot frontend proxy link substituter
Log | Files | Refs | README | LICENSE

commit 78c46842f8ad55171590e1889c8157e10590a07d
parent f9112dc67fa251bd0bc1ebe28855bf1d1a13b823
Author: Byron Torres <b@torresjrjr.com>
Date:   Wed, 31 Mar 2021 13:01:28 +0100

Add MessageHandler filter for non-edited messages

Diffstat:
Mlinkchanbot | 5+++++
1 file changed, 5 insertions(+), 0 deletions(-)

diff --git a/linkchanbot b/linkchanbot @@ -651,7 +651,12 @@ def main(): dp.add_handler(ChosenInlineResultHandler(cb_chosen_inline_result)) dp.add_handler(MessageHandler( + # (not) messages from this bot ~Filters.via_bot(username=BOT_USERNAME) & ( + # non-edited messages + Filters.update.message | Filters.update.channel_post + ) & ( + # messages with links Filters.entity(MessageEntity.URL) | Filters.entity(MessageEntity.TEXT_LINK) | Filters.caption_entity(MessageEntity.URL) |