2017-10-30 12:45:38 +00:00
|
|
|
import multiprocessing
|
|
|
|
import telegrambot
|
|
|
|
import discordbot
|
|
|
|
|
2017-11-15 09:48:58 +00:00
|
|
|
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)
|
2017-10-30 12:45:38 +00:00
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
discord.start()
|
2017-11-10 07:53:48 +00:00
|
|
|
telegram.start()
|
2017-11-15 09:48:58 +00:00
|
|
|
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()
|