import discord import os import threading 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) intents = discord.Intents.all() bot = commands.Bot(command_prefix='!', intents=intents) @bot.event async def on_message(message): try: if message.author != bot.user: except Exception as e: print(f"Error: {e}") 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()