#TypeError: timeout() missing 1 required positional argument: 'time'

1 messages · Page 1 of 1 (latest)

sage geyserBOT
#

Hey! Once your issue is solved, press the button below to close this thread!

neat dust
#

You have it as not required, and it isn't set to for example time = 10, and time isn't even used

dusky needle
#

actually im dumb asf, in async def it should be time: int or whatever

neat dust
#

That wouldn't fix it

#

the problem is that it isn't required, so if there is no time input it won't work

neat dust
#

It isn't to do with that

#

that isn't causing the error

dusky needle
#

why in references instead of time= is communication_disabled_until

neat dust
#
@slash_command(description="Timeout user for a certain time")
@slash_option(
  name="user",
  description="Ping a user",
  required=True,
  opt_type=OptionType.USER
)
@slash_option(
  name="time",
  description="Enter time in minutes",
  required=False,
  opt_type=OptionType.INTEGER
)
async def timeout(ctx: SlashContext, user: Member, time: int = 10):
  await user.timeout(time, reason="kys")```
#

that should work

dusky needle
#
400|Bad Request: communication_disabled_until INVALID_COMMUNICATION_DISABLED_TIMESTAMP: Invalid communication disabled timestamp