-2

So I have been learning discord.py and keep getting stuck in the same part. I don't know what ctx and arg mean. I can't find much in their documentation. I've seen it like ctx.send or async def blank(ctx). What does it do and what use cases would it be used for?

1 Answer 1

3

ctx is short for context. It is used by discord.ext.commands and includes information like who executed the command, where it was executed and so on. ctx.send() is basically a helper function which makes your life easier. You can read its description in the docs to find out how it works and what it does. You just need to read it.


arg is short for argument. It is usually used as a variable length argument list.

Not the answer you're looking for? Browse other questions tagged or ask your own question.