Ask coding questions

← Back to all posts
HELP
Baka000

I am making a discord bot, but I am not able to randomize options, I want them to get 1 random thing from the string but it isn't working.
Can you please help?

I am using python.

Voters
Baka000
Comments
hotnewtop
MrVoo

What do you mean, 'One random item from the string', one random letter?

Baka000

@MrVoo for example, if I had items like swords, staff, and bows, I just want it to pick one from those to give the player.

MrVoo

@Baka000 You mean picking from a list? Use random.choice

Baka000

@MrVoo its not working

MrVoo

@Baka000 Can you show me the line of code?

Baka000

@MrVoo do you have discord?

MrVoo

@Baka000 Nope, but can you copy+paste what line of code isn't working right?

Baka000

@MrVoo
@client.command(aliases=['pick'])
async def _pick(ctx):
starter_monsters = [
'Carcharadon',
'ogre',
'Viperion',
'Scorpio',
'Troll']

MrVoo

@Baka000 It should work, what does the bot say?

Baka000

@MrVoo
do you think you can help with it i can give you edit

MrVoo

@Baka000 I can help if you answer me :P

Baka000

@MrVoo sorry we actually fixed it, we mistakenly spelt it wrong