Update app.py
Browse files
app.py
CHANGED
@@ -6,9 +6,6 @@ import os
|
|
6 |
import sys
|
7 |
import gradio as gr
|
8 |
|
9 |
-
with gr.Blocks() as demo:
|
10 |
-
gr.Markdown("NinoBot machine is working...")
|
11 |
-
|
12 |
ninoToken = os.getenv('ninoToken')
|
13 |
|
14 |
# Initialize the bot with the intents
|
@@ -204,6 +201,28 @@ async def on_message(message):
|
|
204 |
|
205 |
# -----------------------------------------------------------
|
206 |
# Run the bot in a loop
|
207 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
208 |
|
209 |
demo.launch()
|
|
|
6 |
import sys
|
7 |
import gradio as gr
|
8 |
|
|
|
|
|
|
|
9 |
ninoToken = os.getenv('ninoToken')
|
10 |
|
11 |
# Initialize the bot with the intents
|
|
|
201 |
|
202 |
# -----------------------------------------------------------
|
203 |
# Run the bot in a loop
|
204 |
+
def run_bot():
|
205 |
+
if not ninoToken:
|
206 |
+
print("ninoToken NOT SET")
|
207 |
+
event.set()
|
208 |
+
else:
|
209 |
+
bot.run(ninoToken)
|
210 |
+
|
211 |
+
|
212 |
+
threading.Thread(target=run_bot).start()
|
213 |
+
event.wait()
|
214 |
+
|
215 |
+
welcome_message = """
|
216 |
+
## This is Nino the bot for the Designing With Server.
|
217 |
+
You can find more info here: https://github.com/zumatt/ninoBot
|
218 |
+
⚠️ Note ⚠️: The bot is only working on the Designing With Discord Server.
|
219 |
+
"""
|
220 |
+
|
221 |
+
|
222 |
+
with gr.Blocks() as demo:
|
223 |
+
gr.Markdown(f"""
|
224 |
+
# Discord bot of the Designing With Server
|
225 |
+
{welcome_message}
|
226 |
+
""")
|
227 |
|
228 |
demo.launch()
|