WelcomeBot / app.py
lunarflu's picture
lunarflu HF Staff
Update app.py
66b13bc
raw
history blame
714 Bytes
import discord
import os
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='!')
intents = discord.Intents.all()
@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()