Telegram Keyword Bot: Send Sticker via Direct Message

Preface

What about sending a direct message to the user directly?

Requirement

When the keyword naive is detected, send the sticker via direct message

Technical Foundation


GPT-Oriented Development

基于以上代码, 增强开发以下功能
当监控频道中出现"naive "时, 向用户私信发送贴纸.
贴纸为 https://t.me/addstickers/fuckgfwnewbie 的第2个贴纸

注意到监控频道的通知信息是有格式的.
#FOUND (https://t.me/c/1958152252/300436) "自建" IN Joey Huang Blog(1958152252) FROM jacky jay(5979280761)
自建的节点怎么不能访问X和chatgpt啊

#FOUND (https://t.me/LoonCommunity/161393) "大佬" IN Loon Community(@LoonCommunity) FROM Yang Bo(@Zen_Neng_Bu_Bian_Tai)
大佬们,loon怎么在不开梯子的情况下去除广告啊?

通信信息的第1行格式为 #FOUND (源信息) "匹配关键字" IN xxx (群username或userid) FROM yyy (用户username或userid)

Upload to Github


Demo Video


Deployment


========

Postscript

This time (2025-11-09) for GPT-oriented development, the GPT used is

The program generated by GPT has a BUG, getting the plain text of the message
message_text = event.message.message
The correct approach is to extract the markdown text of the message
from telethon.extensions import markdown
message_text = markdown.unparse(event.message.message, event.message.entities)

========

Related Recommendations


Comments