-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathloop.py
More file actions
25 lines (21 loc) · 929 Bytes
/
loop.py
File metadata and controls
25 lines (21 loc) · 929 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from telethon.sync import TelegramClient
import json
import time # Delay দিতে চাইলে
# 📜 Telegram API কনফিগারেশন
# 🔐 config.json থেকে API লোড
with open("config.json") as f:
config = json.load(f)
api_id = config["api_id"]
api_hash = config["api_hash"]
# ✅ Telegram client start
client = TelegramClient('my_session', api_id, api_hash)
client.start()
# 🎯 Receiver Username বা ID (যাকে পাঠাতে চাও)
receiver = input("Input UserName: ")
mymessege = input("Input Message: ")
loopnum = int(input("Input Loop Number: "))
for i in range(1, loopnum + 1): # 1 থেকে loopnum পর্যন্ত
message = f"{mymessege} {i}" # বার্তা তৈরি
client.send_message(receiver, message)
print(f"✅ Sent: {message}")
time.sleep(1) # এক সেকেন্ড delay (spamming যেন না হয়)