Skip to content

Commit fe6f17a

Browse files
committed
Fixed Linting
1 parent 36925ef commit fe6f17a

File tree

1 file changed

+11
-15
lines changed

1 file changed

+11
-15
lines changed

telegram_forward_bot/bot.py

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,20 @@
11
from telethon import TelegramClient, events
22
from telethon.tl.functions.messages import ForwardMessagesRequest
3-
4-
5-
6-
7-
8-
api_id = <Your Telegram API ID>
3+
api_id = 111111
4+
# Replace 111111 with Your Telegram API ID
95
api_hash = 'Your Telegram Hash ID'
106
client = TelegramClient('anon', api_id, api_hash)
7+
8+
119
@client.on(events. NewMessage(outgoing=False))
12-
async def handler(event):
10+
async def handler(event):
1311
chat_id = event.chat_id
14-
# Let's print all the chat ids you are incoming messages from
12+
# Let's print all the chat ids you are incoming messages from
1513
print(chat_id)
16-
#If you just want to get messages from 1 chat just remove the or statement after the 1st one
17-
if chat_id ==<Chat Id of the origin message Here> or chat_id==<Chat Id of the origin message Here> or chat_id==<Chat Id of the origin message Here>:
14+
if chat_id == 22222:
15+
# Replace 22222 with the Chat Id of the origin message Here
1816
msg = event.raw_text
19-
await client. send_message(<Chat Id of of the Chat Where To Send>,msg)
20-
21-
22-
17+
await client. send_message(44444, msg)
18+
# Replace 44444 with the Chat Id of of the Chat Where To Send
2319
client.start()
24-
client.run_until_disconnected()
20+
client.run_until_disconnected()

0 commit comments

Comments
 (0)