ку, pip install python-telegram-bot==13.1
main.py:
import telegram # pip install python-telegram-bot
TOKEN = "6474625909:AAH2-NVAUO4iAKeJ2phbwHImZSgj063-qw5U"
START_MSG = 1
STOP_MSG = 10
DEST_ID = "@agemanus" #куда
SRC_ID = "@contracityofficial" #откуда
#можно использовать как юзернейм так и айди
auth = telegram.Bot(token=TOKEN)
def forward(START_MSG):
try :
for msg in range (START_MSG,STOP_MSG+1):
telegram.Bot.forwardMessage(auth, chat_id=DEST_ID, from_chat_id=SRC_ID, message_id=msg)
except telegram.error.BadRequest:
START_MSG = msg+1
forward(START_MSG)
if __name__ == "__main__":
forward(START_MSG)
Последнее редактирование: