Ask coding questions

← Back to all posts
Why is my bot not working?
Nithen (0)

I have made a bot that sends images in Discord. But, when I type 'rpg!monsters' on Discord, an error occurs in line 26. Pls help me!

Comments
hotnewtop
Coder100 (16868)

Try making them local, so change line 7 to:

spawnables = ['./bootlegflowey.gif', './scaldamander.gif']

also please SEND YOUR ERROR!

Nithen (0)

@Coder100 I have tried what you've given, but it's still not working. I'll give you the error--

Coder100 (16868)

oh lol you sent in the array not a random monster from it

spawn = random.choice(spawnables)
await message.channel.send (file=discord.File (spawn))  

@Nithen

Nithen (0)

@Coder100 its working... but it's only showing one random monster. I want it to show all of the monsters on the list. Thanks anyways!