Basic ui implementation.
This commit is contained in:
16
main.py
16
main.py
@@ -4,6 +4,10 @@ from discord.ext import tasks, commands
|
||||
from dotenv import load_dotenv
|
||||
from dom5game import Dom5game
|
||||
from servermanager import create_server
|
||||
from nicegui import ui
|
||||
from ui import create_ui
|
||||
import threading
|
||||
|
||||
|
||||
intents = discord.Intents.default()
|
||||
bot = commands.Bot(command_prefix="!", intents=intents)
|
||||
@@ -23,10 +27,6 @@ def reload_games():
|
||||
)
|
||||
|
||||
|
||||
create_server("Amogus", 7777, 831955362646851617)
|
||||
reload_games()
|
||||
|
||||
|
||||
@bot.event
|
||||
async def on_ready():
|
||||
print(f"Logged in as {bot.user}")
|
||||
@@ -93,4 +93,10 @@ async def task_loop():
|
||||
game.to_json()
|
||||
|
||||
|
||||
bot.run(TOKEN)
|
||||
def start_bot():
|
||||
bot.run(TOKEN)
|
||||
|
||||
|
||||
threading.Thread(target=start_bot, daemon=True).start()
|
||||
create_ui()
|
||||
ui.run()
|
||||
|
||||
Reference in New Issue
Block a user