1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-24 03:54:20 +00:00
royalnet/bots.py
2018-01-20 15:28:04 +01:00

18 lines
No EOL
681 B
Python

import multiprocessing
import telegrambot
import discordbot
import time
discord_telegram_pipe = multiprocessing.Pipe()
discord = multiprocessing.Process(target=discordbot.process, args=(discord_telegram_pipe[0],), daemon=True)
telegram = multiprocessing.Process(target=telegrambot.process, args=(discord_telegram_pipe[1],), daemon=True)
if __name__ == "__main__":
discord.start()
telegram.start()
while True:
if discord.exitcode is not None:
print("Restarting Discord Bot...")
discord = multiprocessing.Process(target=discordbot.process, args=(discord_telegram_pipe[0],), daemon=True)
discord.start()
time.sleep(60)