Skip to content

Commit e33fd8e

Browse files
authored
docs(cogs): add necessary ctx parameter to math command examples (#491)
Signed-off-by: bmzr <[email protected]>
1 parent 64b8e77 commit e33fd8e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/popular-topics/cogs.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ class Greetings(commands.Cog): # create a class for our cog that inherits from c
4444
)
4545

4646
@math.command()
47-
async def add(self, a: int, b: int):
47+
async def add(self, ctx, a: int, b: int):
4848
c = a + b
4949
await ctx.respond(f"{a} + {b} is {c}.")
5050

5151
@advanced_math.command()
52-
async def midpoint(self, x1: float, y1: float, x2: float, y2: float):
52+
async def midpoint(self, ctx, x1: float, y1: float, x2: float, y2: float):
5353
mid_x = (x1 + x2)/2
5454
mid_y = (y1 + y2)/2
5555
await ctx.respond(f"The midpoint between those coordinates is ({mid_x}, {mid_y}).")

0 commit comments

Comments
 (0)