0

我已经有一个在 python 上工作的电报机器人,它使用 api hash 和 app_id 工作,并且工作而不是用户本身而不是代理!启动后需要在终端上进行两步验证,但在 heroku 上没有终端,我如何在 heruku 上运行这样的机器人?

`

from telethon import TelegramClient, events, sync
import  asyncio

api_id = ****
api_hash = '*****'
chat='https://t.me/joinchat/telchat'
bot='https://t.me/joinchat/second tell chat'

client = TelegramClient('usser', api_id, api_hash)

@client.on(events.NewMessage())
async def main(event):
  
    await client.forward_messages(chat, event.message)

client.start()
client.run_until_disconnected()

`

4

1 回答 1

0

我不知道它是否可以解决您的整个问题,但是您可以从 heroku docs 中查看这篇文章:here

于 2021-03-28T18:49:04.433 回答