kik-bot-api-unofficial
kik-bot-api-unofficial copied to clipboard
Is it possible to create several bots?
I am trying to do roughly the following:
bot0 = Bot(username=username0,password = password0)
bot1 = Bot(username=username1,password = password1)
bot0.client.send_chat_message(recipient, message)
bot1.client.send_chat_message(recipient, message)
However, connection management seems to be not very happy with that.
I use this technique to connect multiple bots:
python Bot.py 1& => Launch the bot to connect account ID 1 python Bot.py 2& => Launch the bot to connect account ID 2 ..... A launcher program have to launch bots :)
I use something like this for Rage Bot:
for account in accounts:
Thread(target=bot_thread, args=([account]), name=account.username).start()
time.sleep(0.1)
def bot_thread(account):
asyncio.set_event_loop(asyncio.new_event_loop())
RageBot(account.username, account.password)
A couple of things to keep in mind:
- device_id and android_id need to be unique per bot, you can use the override arguments for login etc
- device_id and android_id need to be the same each time you log in for a specific bot, so you need to store that somewhere
Cool, Was having errors trying to start many bot threads from the same main thread. "asyncio main loop error".
It's why my program use only 1 account, and a launcher is dedicated to start X programs with the "&" directive.
I'll try your method with asyncio.set_event_loop(asyncio.new_event_loop())
Thanks for this ;)