lunarflu HF Staff commited on
Commit
f772cc3
·
1 Parent(s): 57f129c

initial commit

Browse files
Files changed (1) hide show
  1. app.py +24 -0
app.py ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import discord
2
+ from discord.ext import commands
3
+
4
+ import gradio_client
5
+ import gradio as gr
6
+ from gradio_client import Client
7
+
8
+ DISCORD_TOKEN = os.environ.get("DISCORD_TOKEN", None)
9
+ bot = commands.Bot(command_prefix='!')
10
+
11
+ @bot.event
12
+ async def on_member_join(member):
13
+ channel = bot.get_channel(1130822235028992061)
14
+ message = f'Welcome to the server, {member.mention}!'
15
+ await channel.send(message)
16
+
17
+ DISCORD_TOKEN = os.environ.get("DISCORD_TOKEN", None)
18
+ def run_bot():
19
+ bot.run(DISCORD_TOKEN)
20
+ threading.Thread(target=run_bot).start()
21
+ def greet(name):
22
+ return "Hello " + name + "!"
23
+ demo = gr.Interface(fn=greet, inputs="text", outputs="text")
24
+ demo.launch()