Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -172,11 +172,13 @@ async def post_to_slack(author, content, channel, url, slack_mention, trigger):
|
|
| 172 |
|
| 173 |
|
| 174 |
# runs discord bot in thread = helps avoid blocking calls
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
|
|
|
|
|
|
| 180 |
def greet(name):
|
| 181 |
return "Hello " + name + "!"
|
| 182 |
demo = gr.Interface(fn=greet, inputs="text", outputs="text")
|
|
|
|
| 172 |
|
| 173 |
|
| 174 |
# runs discord bot in thread = helps avoid blocking calls
|
| 175 |
+
async def run_bot():
|
| 176 |
+
async with bot:
|
| 177 |
+
bot.loop.create_task(collect_pings())
|
| 178 |
+
bot.run(DISCORD_TOKEN)
|
| 179 |
+
def start_bot_thread():
|
| 180 |
+
asyncio.run(run_bot())
|
| 181 |
+
threading.Thread(target=start_bpt_thread).start()
|
| 182 |
def greet(name):
|
| 183 |
return "Hello " + name + "!"
|
| 184 |
demo = gr.Interface(fn=greet, inputs="text", outputs="text")
|