Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

cant add lowercase text discord bot in python

I have a small code to use it in discord created in python and I have a small problem

The command is currently written in uppercase text and I would like it to be written in lowercase, if it is not written in lowercase the bot does not send the images to discord

he command is used:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

!ubi ESTABLO ELEVADO

Should be used:

!ubi establo elevado

but in this case it does not work for me I have tried several codes and it does not work:

This is the code:

@bot.command()
async def ubi(ctx, *, args):
    response = requests.get('https://jose89fcb.es/apifortnite/api.io.php')
    data = response.json()
    for api in data['list']:
        if args in api["name"]:
            await ctx.send(f'{api["images"][0]["url"]}')

>Solution :

this is what you are looking for!

@bot.command()
    async def ubi(ctx, *, args):
        response = requests.get('https://jose89fcb.es/apifortnite/api.io.php')
        data = response.json()
        for api in data['list']:
            if args in api["name"].lower():
               
                await ctx.send(f'{api["images"][0]["url"]}')
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading