'telethon forward messages without a specific word
I am using a telegram bot that forwards messages from a certain channel to any other channel I am on, but I want it to forward these messages without a word, for example the message ends with "flowers", I want the bot to forward the message without the word "flowers".
@BotzHubUser.on(events.NewMessage(incoming=True, chats=FROM))
async def sender_bH(event):
for i in TO:
try:
await BotzHubUser.send_message(
i,
event.message
)
Solution 1:[1]
As said in the docs try :
@client.on(events.NewMessage)
async def my_event_handler(event):
if 'flower' not in event.raw_text:
await event.reply('hi!')
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | kr3ypt0n |