lunarflu HF staff commited on
Commit
a5603d3
1 Parent(s): 2694715

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +29 -0
app.py ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import discord
2
+ import os
3
+ import threading
4
+ from discord.ext import commands
5
+
6
+ import gradio_client
7
+ import gradio as gr
8
+ from gradio_client import Client
9
+
10
+ DISCORD_TOKEN = os.environ.get("DISCORD_TOKEN", None)
11
+ intents = discord.Intents.all()
12
+ bot = commands.Bot(command_prefix='!', intents=intents)
13
+
14
+ @bot.event
15
+ async def on_message(message):
16
+ try:
17
+ if message.author != bot.user:
18
+
19
+ except Exception as e:
20
+ print(f"Error: {e}")
21
+
22
+ DISCORD_TOKEN = os.environ.get("DISCORD_TOKEN", None)
23
+ def run_bot():
24
+ bot.run(DISCORD_TOKEN)
25
+ threading.Thread(target=run_bot).start()
26
+ def greet(name):
27
+ return "Hello " + name + "!"
28
+ demo = gr.Interface(fn=greet, inputs="text", outputs="text")
29
+ demo.launch()