Update app.py
Browse files
app.py
CHANGED
@@ -9,6 +9,7 @@ import gradio as gr
|
|
9 |
from discord import Permissions
|
10 |
from discord.ext import commands
|
11 |
from discord.utils import oauth_url
|
|
|
12 |
|
13 |
import gradio_client as grc
|
14 |
from gradio_client.utils import QueueError
|
@@ -61,8 +62,8 @@ thread_to_user = {}
|
|
61 |
|
62 |
## /echo command to return the llm repsonse ##
|
63 |
|
64 |
-
@bot.
|
65 |
-
async def cryptotrend(ctx, period:
|
66 |
if ctx.author.id == bot.user.id:
|
67 |
return
|
68 |
|
@@ -86,6 +87,7 @@ async def cryptotrend(ctx, period: discord.Option(str, "Choose the period", choi
|
|
86 |
await ctx.send("The gradio space powering this bot is really busy! Please try again later!")
|
87 |
except Exception as e:
|
88 |
print(f"{e}")
|
|
|
89 |
|
90 |
@bot.hybrid_command(name="cshelp", description="Get information on how to use this bot.")
|
91 |
async def help_command(ctx):
|
|
|
9 |
from discord import Permissions
|
10 |
from discord.ext import commands
|
11 |
from discord.utils import oauth_url
|
12 |
+
from discord.commands import Option # Import Option for slash commands
|
13 |
|
14 |
import gradio_client as grc
|
15 |
from gradio_client.utils import QueueError
|
|
|
62 |
|
63 |
## /echo command to return the llm repsonse ##
|
64 |
|
65 |
+
@bot.slash_command(name="cryptotrend", description="Find top trending cryptocurrencies for a specific period.")
|
66 |
+
async def cryptotrend(ctx, period: Option(str, "Choose the period", choices=["day", "week", "month"])):
|
67 |
if ctx.author.id == bot.user.id:
|
68 |
return
|
69 |
|
|
|
87 |
await ctx.send("The gradio space powering this bot is really busy! Please try again later!")
|
88 |
except Exception as e:
|
89 |
print(f"{e}")
|
90 |
+
|
91 |
|
92 |
@bot.hybrid_command(name="cshelp", description="Get information on how to use this bot.")
|
93 |
async def help_command(ctx):
|