Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<ThreadChannel>.members.remove() DiscordAPIError[0] : 405: Method Not Allowed #9999

Closed
SENPAY98K opened this issue Nov 25, 2023 · 3 comments
Closed

Comments

@SENPAY98K
Copy link

Which package is this bug report for?

discord.js

Issue description

Adding users works fine, but removing does work

DiscordAPIError[0]: 405: Method Not Allowed
    at handleErrors (D:\SCRIPTS\EXUY SCRIPTS\Discord-Bot\node_modules\@discordjs\rest\dist\index.js:722:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async SequentialHandler.runRequest (D:\SCRIPTS\EXUY SCRIPTS\Discord-Bot\node_modules\@discordjs\rest\dist\index.js:1120:23)
    at async SequentialHandler.queueRequest (D:\SCRIPTS\EXUY SCRIPTS\Discord-Bot\node_modules\@discordjs\rest\dist\index.js:953:14)
    at async _REST.request (D:\SCRIPTS\EXUY SCRIPTS\Discord-Bot\node_modules\@discordjs\rest\dist\index.js:1266:22)
    at async ThreadMemberManager.remove (D:\SCRIPTS\EXUY SCRIPTS\Discord-Bot\node_modules\discord.js\src\managers\ThreadMemberManager.js:111:5)
    at async Object.run (D:\SCRIPTS\EXUY SCRIPTS\Discord-Bot\#Buttons\Thread\closeThread.js:44:44)
    at async Object.run (D:\SCRIPTS\EXUY SCRIPTS\Discord-Bot\Events\Interaction\buttons.js:36:9)

Code sample

No response

Versions

Discord.js 14.14.1
Node.js 20.9.0
Javascript Vanilla
Windows & Ubunto

Issue priority

Medium (should be fixed soon)

Which partials do you have configured?

Channel, ThreadMember

Which gateway intents are you subscribing to?

Not applicable

I have tested this issue on a development release

No response

@almostSouji
Copy link
Member

almostSouji commented Nov 25, 2023

I can only reproduce this, if i call the method without arguments, which is expected. The id argument is not optional.
Ref: #remove(id)

Detail:

async remove(id, reason) {
await this.client.rest.delete(Routes.threadMembers(this.thread.id, id), { reason });
return id;

DELETE /channels/:id/thread-members/ is not part of the API

@SENPAY98K
Copy link
Author

I can only reproduce this, if i call the method without arguments, which is expected. The id argument is not optional. Ref: #remove(id)

Im using the user id

image

@almostSouji
Copy link
Member

almostSouji commented Nov 25, 2023

validate the value of that during runtime. the error you showed is just possible if the route itself does not exist for that method (DELETE in this case), which means the route cannot be /channels/:id/thread-members/:id. if it was, this would not cause 405

@Jiralite Jiralite closed this as not planned Won't fix, can't repro, duplicate, stale Nov 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants