Spaces:
Runtime error
Runtime error
import os | |
import discord | |
from discord.ext import commands | |
from src.chatbot import Chatbot | |
from src.imagebot import Imagebot | |
intents = discord.Intents.default() | |
bot = commands.Bot(command_prefix="/", intents=intents) | |
chatbot = Chatbot(os.environ["poe_api_token"]) | |
imagebot = Imagebot(os.environ["replicate_api_token"]) | |
async def on_ready(): | |
print(f"Logged in as {bot.user} (ID: {bot.user.id})") | |
async def q(ctx, *query): | |
query = " ".join(query) | |
await ctx.send(f"{chatbot.query_from_api(query=query)}") | |
async def gen(ctx, *query): | |
query = " ".join(query) | |
await ctx.send(imagebot.generate_image(query=query)) | |
async def python(ctx, *query): | |
query = " ".join(query) | |
await ctx.send(f"{exec(query)}") | |
bot.run(os.environ["discord_token"]) | |