Pycord-Development / pycord

Pycord is a modern, easy to use, feature-rich, and async ready API wrapper for Discord written in Python
https://docs.pycord.dev
MIT License
2.74k stars 463 forks source link

405 when registering slash commands #1349

Closed jaimevisser closed 2 years ago

jaimevisser commented 2 years ago

Summary

405 when registering slash commands

Reproduction Steps

Run previously working code. No changes.

Minimal Reproducible Code

https://github.com/jaimevisser/scrimbot

Expected Results

Slash commands work.

Actual Results

Ignoring exception in on_connect Traceback (most recent call last): File "/Users/jaime/GitHub/scrimbot/venv/lib/python3.9/site-packages/discord/client.py", line 382, in _run_event await coro(*args, **kwargs) File "/Users/jaime/GitHub/scrimbot/venv/lib/python3.9/site-packages/discord/bot.py", line 1147, in on_connect await self.sync_commands() File "/Users/jaime/GitHub/scrimbot/venv/lib/python3.9/site-packages/discord/bot.py", line 770, in sync_commands await self._bot.http.bulk_upsert_command_permissions(self._bot.user.id, guild_id, guild_cmd_perms) File "/Users/jaime/GitHub/scrimbot/venv/lib/python3.9/site-packages/discord/http.py", line 359, in request raise HTTPException(response, data) discord.errors.HTTPException: 405 Method Not Allowed (error code: 0): 405: Method Not Allowed

Intents

intents.members = True

System Information

py-cord @ git+https://github.com/Pycord-Development/pycord@ab95493a3a56aa03ce92de13de401b6cf6e58715

Checklist

Additional Context

No response

jab416171 commented 2 years ago

This is fixed in master.

jaimevisser commented 2 years ago

Still reproducible with 8df222d86319dd16a5e55958524634319836e7cf (current master)

jaimevisser commented 2 years ago

Minimally reproducible code. Seems to be the 'guild_ids' parameter to slash_command that breaks it.

bot = discord.Bot()

@bot.slash_command(guild_ids=[id_here])
async def ping(
        ctx
):
    await ctx.respond("pong")

bot.run(config.token)
plun1331 commented 2 years ago

Minimally reproducible code. Seems to be the 'guild_ids' parameter to slash_command that breaks it.

bot = discord.Bot()

@bot.slash_command(guild_ids=[id_here])
async def ping(
        ctx
):
    await ctx.respond("pong")

bot.run(config.token)

Please send your traceback

jaimevisser commented 2 years ago

Dirty venv. Cleaned and now it does work. PEBKAC