We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@app_commands.command(name="texttoimg",description="Give your prompt to generate image") async def texttoimg(self,interaction: discord.Interaction,prompt: str): # await interaction.response.send_message("Generating: "+prompt+" ....") generator = Craiyon() generated_images = await generator.async_generate(prompt) b64_list = await craiyon_utils.async_encode_base64(generated_images.images) images1 = [] for index, image in enumerate(b64_list): img_bytes = BytesIO(base64.b64decode(image)) # image = discord.File(img_bytes) image = discord.File(img_bytes) image.filename = f"result{index}.webp" images1.append(image) await interaction.response.send_message(files=images1)
If i print in console it works well, but doesn't send img to discord
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Code:
Output:
If i print in console it works well, but doesn't send img to discord
The text was updated successfully, but these errors were encountered: