FireHead90544 / craiyon.py

Unofficial API Wrapper for craiyon.com (DAL-E-MINI). Generate awesome images from text tokens.
Apache License 2.0
69 stars 22 forks source link

AttributeError: 'Craiyon' object has no attribute 'async_generate' #6

Closed DragonFire1230 closed 1 year ago

DragonFire1230 commented 1 year ago

hello, i have some problems. i am making discord bot, and i can't call async_generate

here's my code:


async def dall_e_mini(ctx, prompt: str):
    await ctx.response.defer()
    craiyon_gen = Craiyon()

    result = await craiyon_gen.async_generate(prompt)
    await result.async_save_images(path = f".\\temp\\{ctx.author.id}")

    files_to_upload = []

    for file in os.listdir(f'.\\temp\\{ctx.author.id}'):
        files_to_upload.append(discord.File(f'.\\temp\\{ctx.author.id}\\{file}'))

    await ctx.send(f'**{prompt}** - {ctx.author.mention}', files=files_to_upload)```

what i do not right?
i'm using Python 3.10.7
DragonFire1230 commented 1 year ago

i solved in by just downloading source code, and moving to my project

FireHead90544 commented 1 year ago

The new version wasn't published to pypi by that time, I'll be doing that now. It'll fix that issue.