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
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.