File size: 489 Bytes
0fcc781
 
5ce3a86
 
 
 
4095ff4
5ce3a86
 
fbb3e90
5ce3a86
 
 
4095ff4
5ce3a86
 
4095ff4
5ce3a86
 
0fcc781
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# app.py

import asyncio
import nest_asyncio
from gradio_interface import create_gradio_interface
from discord_bot import run_discord_bot

# Apply nest_asyncio to allow nested event loops
nest_asyncio.apply()

if __name__ == "__main__":
    # Create the event loop
    loop = asyncio.get_event_loop()

    # Start the Discord bot in the event loop
    loop.create_task(run_discord_bot())

    # Create and launch the Gradio interface
    demo = create_gradio_interface()
    demo.launch()