WelcomeBot / app.py
lunarflu's picture
lunarflu HF Staff
initial commit
f772cc3
raw
history blame
671 Bytes
import discord
from discord.ext import commands
import gradio_client
import gradio as gr
from gradio_client import Client
DISCORD_TOKEN = os.environ.get("DISCORD_TOKEN", None)
bot = commands.Bot(command_prefix='!')
@bot.event
async def on_member_join(member):
channel = bot.get_channel(1130822235028992061)
message = f'Welcome to the server, {member.mention}!'
await channel.send(message)
DISCORD_TOKEN = os.environ.get("DISCORD_TOKEN", None)
def run_bot():
bot.run(DISCORD_TOKEN)
threading.Thread(target=run_bot).start()
def greet(name):
return "Hello " + name + "!"
demo = gr.Interface(fn=greet, inputs="text", outputs="text")
demo.launch()