|
|
import logging |
|
|
import os |
|
|
import asyncio |
|
|
|
|
|
from multiprocessing import Process |
|
|
from rac_bot import bot |
|
|
import nationstates_main |
|
|
from ballsdex_hash import hash_balldex_images |
|
|
import gradio as gr |
|
|
|
|
|
|
|
|
logging.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(levelname)s - %(message)s') |
|
|
|
|
|
|
|
|
"""with concurrent.futures.ThreadPoolExecutor() as executor: |
|
|
executor.submit(asyncio.run, autoupdate_grades_habitica(db_client)) |
|
|
executor.submit(asyncio.run, bot.start(os.getenv('BOT_TOKEN')))""" |
|
|
|
|
|
def greet(name): |
|
|
return "Hello " + name + "!!" |
|
|
|
|
|
demo = gr.Interface(fn=greet, inputs="text", outputs="text") |
|
|
|
|
|
tasks = [] |
|
|
|
|
|
tasks.append(Process(target=bot.run, args=(os.getenv('BOT_TOKEN'),))) |
|
|
|
|
|
tasks.append(Process(target=demo.launch)) |
|
|
|
|
|
for task in tasks: |
|
|
task.start() |
|
|
|
|
|
for task in tasks: |
|
|
task.join() |
|
|
|
|
|
|
|
|
|