import discord, asyncio
client = discord.Client()
@client.event
async def on_ready():
print(f"{client.user.name} is ready!")
channel = client.get_channel(CHANNEL_ID)
if channel is not None:
print("channel is not none")
async for cmd in channel.slash_commands(query="ping"):
if cmd.name == "ping":
print("slash found")
await asyncio.sleep(1)
print("sending slash")
try:
await cmd()
except discord.Forbidden as e:
print(f"i have no permissions {repr(e)}")
break
else:
print("i didnt found slash")
else:
print("channel is none")
await asyncio.sleep(3)
await client.close()
client.run(TOKEN)
Expected Results
client uses /ping
Actual Results
Traceback (most recent call last):
File "D:\Python\prj\discord\client.py", line 381, in _run_event
await coro(*args, *kwargs)
File "D:\Python\prj\test.py", line 17, in on_ready
await cmd()
return await super().call(self._parse_kwargs(kwargs), channel)
File "D:\Python\prj\discord\commands.py", line 273, in call
return await super().call(data, files, channel)
File "D:\Python\prj\discord\commands.py", line 116, in call
await state.http.interact(type, data, acc_channel, files=files, nonce=nonce, application_id=self.application_id)
File "D:\Python\prj\discord\http.py", line 580, in request
raise HTTPException(response, data)
discord.errors.HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
In data: Invalid interaction application command
System Information
Python v3.10.6-final
aiohttp v3.8.1
discord v2.0.0a2
system info: Windows 10 10.0.19044
Checklist
[X] I have searched the open issues for duplicates.
[X] I have shared the entire traceback.
[X] I am using a user token (and it isn't visible in the code).
Summary
Invalid Form Body when sending slash-command
Reproduction Steps
Code
Expected Results
client uses /ping
Actual Results
Traceback (most recent call last): File "D:\Python\prj\discord\client.py", line 381, in _run_event await coro(*args, *kwargs) File "D:\Python\prj\test.py", line 17, in on_ready await cmd() return await super().call(self._parse_kwargs(kwargs), channel) File "D:\Python\prj\discord\commands.py", line 273, in call return await super().call(data, files, channel) File "D:\Python\prj\discord\commands.py", line 116, in call await state.http.interact(type, data, acc_channel, files=files, nonce=nonce, application_id=self.application_id) File "D:\Python\prj\discord\http.py", line 580, in request raise HTTPException(response, data) discord.errors.HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body In data: Invalid interaction application command
System Information
Checklist
Additional Information
No response