I
I
idp212020-12-16 22:58:52
Python
idp21, 2020-12-16 22:58:52

I wrote a code to drop a random number, but an error occurs, who knows what's wrong?

Here is the code itself:

@client.command( pass_context = True)
async def rolldice(self, ctx):
n = random.randrange(1, 6)
await stx.send(n)


Mistake:5fda66df3d176948949874.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
soremix, 2020-12-16
@idp21

Written stx instead of ctx...

Y
Yuriy Vorobyov, 2020-12-16
@YuriyVorobyov1333

You have written in the console: the name 'stx' is not defined

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question