Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Update app.py
Browse files
app.py
CHANGED
@@ -1,13 +1,18 @@
|
|
1 |
import discord
|
|
|
|
|
2 |
from discord.ext import commands
|
3 |
import json
|
4 |
import time
|
5 |
import matplotlib.pyplot as plt
|
6 |
from io import BytesIO
|
|
|
|
|
|
|
7 |
|
8 |
-
intents = discord.Intents.default()
|
9 |
-
intents.message_content = True
|
10 |
|
|
|
|
|
11 |
bot = commands.Bot(command_prefix='!', intents=intents)
|
12 |
|
13 |
XP_PER_MESSAGE = 10
|
@@ -83,4 +88,17 @@ async def show_xp_data(ctx):
|
|
83 |
else:
|
84 |
await ctx.send('You have not earned any XP yet.')
|
85 |
|
86 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import discord
|
2 |
+
import os
|
3 |
+
import threading
|
4 |
from discord.ext import commands
|
5 |
import json
|
6 |
import time
|
7 |
import matplotlib.pyplot as plt
|
8 |
from io import BytesIO
|
9 |
+
import gradio_client
|
10 |
+
import gradio as gr
|
11 |
+
from gradio_client import Client
|
12 |
|
|
|
|
|
13 |
|
14 |
+
DISCORD_TOKEN = os.environ.get("DISCORD_TOKEN", None)
|
15 |
+
intents = discord.Intents.all()
|
16 |
bot = commands.Bot(command_prefix='!', intents=intents)
|
17 |
|
18 |
XP_PER_MESSAGE = 10
|
|
|
88 |
else:
|
89 |
await ctx.send('You have not earned any XP yet.')
|
90 |
|
91 |
+
|
92 |
+
|
93 |
+
|
94 |
+
|
95 |
+
|
96 |
+
""""""
|
97 |
+
DISCORD_TOKEN = os.environ.get("DISCORD_TOKEN", None)
|
98 |
+
def run_bot():
|
99 |
+
bot.run(DISCORD_TOKEN)
|
100 |
+
threading.Thread(target=run_bot).start()
|
101 |
+
def greet(name):
|
102 |
+
return "Hello " + name + "!"
|
103 |
+
demo = gr.Interface(fn=greet, inputs="text", outputs="text")
|
104 |
+
demo.launch()
|