vendredi 12 avril 2019

I wanna do like if statement for random image

guys, I made a discord bot now I have a !dice command that randomly choosing an image of a dice side ( 1,6 ) I made the array that contains all the links for the cube sides and I don't know how to make an if statement I mean I have basic knowledge but I am new to python and their arrays

dice = ["https://i.imgur.com/mMuucMf.png",
       "https://i.imgur.com/vOynQes.png",
       "https://i.imgur.com/ND88fBj.png",
       "https://i.imgur.com/id4Qoou.png",
       "https://i.imgur.com/RmmK7Ny.png",
       "https://i.imgur.com/LCtlhZo.png"]


  if message.content.upper().startswith('!DICE'):
       for i in range(10):
       await client.send_message(message.channel, random.choice(dice))
       if random.choice(dice) == "https://i.imgur.com/LCtlhZo.png":
           await client.send_message(message.channel, "You rolled 6")

Thanks for the helpers :D

Aucun commentaire:

Enregistrer un commentaire