Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -174,11 +174,12 @@ async def post_to_slack(author, content, channel, url, slack_mention, trigger):
|
|
| 174 |
|
| 175 |
# runs discord bot in thread = helps avoid blocking calls
|
| 176 |
async def run_bot():
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
bot.run(DISCORD_TOKEN)
|
| 180 |
def start_bot_thread():
|
| 181 |
-
asyncio.
|
|
|
|
|
|
|
| 182 |
threading.Thread(target=start_bot_thread).start()
|
| 183 |
def greet(name):
|
| 184 |
return "Hello " + name + "!"
|
|
|
|
| 174 |
|
| 175 |
# runs discord bot in thread = helps avoid blocking calls
|
| 176 |
async def run_bot():
|
| 177 |
+
bot.loop.create_task(collect_pings())
|
| 178 |
+
await bot.start(DISCORD_TOKEN)
|
|
|
|
| 179 |
def start_bot_thread():
|
| 180 |
+
loop = asyncio.new_event_loop()
|
| 181 |
+
asyncio.set_event_loop(loop)
|
| 182 |
+
loop.run_until_complete(run_bot())
|
| 183 |
threading.Thread(target=start_bot_thread).start()
|
| 184 |
def greet(name):
|
| 185 |
return "Hello " + name + "!"
|