Home>

I have two bots -two files. In the first file, the client variable, in the second client2. I'm trying to run both of these bots at the same time using a third file with the following code:

import bot_1
import bot_2
bot_1.client.run('token')
bot_2.client2.run('token')

If my whole train of thought is wrong, then how can I run two bots at the same time?

  • Answer # 1

    Try this:

    bot_1.client.start()
    bot_2.client2.run()
    

    On the first line I get an error: RuntimeWarning: Enable tracemalloc to get the object allocation traceback Cannot use an async function, outside of a function, what can I do about it?

    Stalono2022-02-03 18:35:49
  • Answer # 2

    Try this:

    bot_1.client.start()
    bot_2.client2.run()
    

    On the first line I get an error: RuntimeWarning: Enable tracemalloc to get the object allocation traceback Cannot use an async function, outside of a function, what can I do about it?

    Stalono2022-02-03 18:35:49