i need to start bot on server with nohup

  python, telethon

i need to start bot on server. I use nohup, but its wrong. telethon use input() for authorization. But nonup ignor this function. What i have to do?

code:

from telethon import TelegramClient, events

api_id   = 0
api_hash = 'hash'

session = 'my'

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


@client.on(events.NewMessage(incoming=True))
async def func(event):

    name_bot = '@betta_test'

    chat = await client.get_entity(name_bot)

    await event.message.forward_to(chat)


client.start()
client.run_until_disconnected()

Source: Python Questions

LEAVE A COMMENT