Sandushki / discord.ext_BOT

This repository is a bot that I coded for my Python course which uses the discord.ext.commands's bot class (shorter and easier).
1 stars 0 forks source link

HW 1 Functions I did #1

Open Sandushki opened 4 months ago

Sandushki commented 4 months ago

Image Rarity function

The image rarity function shows the rarity of the images sent.

rarity = ""
for i in range(len(randomPicture)):
    if randomPicture[i] == "e":
        break

    else:
        rarity += randomPicture[i]
rarity = len(rarity)

await ctx.send(f"Ayrıca, bu çıkan resmin nadirliği {rarity}'de 1'dir.\n\nŞansa bak!")
Sandushki commented 4 months ago

Added Functions

I added some functions for my homework.

def komutCikar():
    komutlar =("Her komut ünlem ile başlamak üzere;\n\n    hello\n    bye\n    sifreOlustur\n    YaziTura\n    rastgeleEmoji\n    mention\n    resim\n    clear\n\nolmak üzere,\nbüyük-küçük harflerin yazılımına dikkat edin.")

    return(komutlar)

@bot.command()
async def komutlar(ctx):
    await ctx.send(komutCikar())

--- and ---

@bot.command()
async def bye(ctx):
    await ctx.send("Gitme, geri gel!")