Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
threading
Browse files
app.py
CHANGED
|
@@ -1,4 +1,6 @@
|
|
| 1 |
import discord
|
|
|
|
|
|
|
| 2 |
from discord.ext import commands
|
| 3 |
from slack_sdk import WebClient
|
| 4 |
from slack_sdk.errors import SlackApiError
|
|
@@ -43,4 +45,14 @@ async def post_to_slack(content, slack_mention):
|
|
| 43 |
except SlackApiError as e:
|
| 44 |
print(f"Error posting to Slack: {e.response['error']}")
|
| 45 |
|
| 46 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import discord
|
| 2 |
+
import threading
|
| 3 |
+
import gradio as gr
|
| 4 |
from discord.ext import commands
|
| 5 |
from slack_sdk import WebClient
|
| 6 |
from slack_sdk.errors import SlackApiError
|
|
|
|
| 45 |
except SlackApiError as e:
|
| 46 |
print(f"Error posting to Slack: {e.response['error']}")
|
| 47 |
|
| 48 |
+
|
| 49 |
+
def run_bot():
|
| 50 |
+
bot.run(DISCORD_TOKEN)
|
| 51 |
+
|
| 52 |
+
threading.Thread(target=run_bot).start()
|
| 53 |
+
|
| 54 |
+
def greet(name):
|
| 55 |
+
return "Hello " + name + "!"
|
| 56 |
+
|
| 57 |
+
demo = gr.Interface(fn=greet, inputs="text", outputs="text")
|
| 58 |
+
demo.launch()
|