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

GET /webhooks/ endpoint requires MANAGE_WEBHOOKS Permission to fetch an app/bot's own Webhook(s) in a Guild #6701

Open
TwilightZebby opened this issue Mar 7, 2024 · 0 comments
Labels
bug synced Synced to internal tracker

Comments

@TwilightZebby
Copy link

TwilightZebby commented Mar 7, 2024

Description

The GET /webhooks/ Endpoints are not documented as requiring any Server Permission, yet trying to fetch a Webhook owned by the App/Bot calling the endpoint, while said Bot doesn't have the MANAGE_WEBHOOKS in the Channel/Server the Webhook is in, results in a "Missing Permissions" error.

This might also affect App-owned Webhooks created via OAuth, in addition to created via the standard Bot API.

Steps to Reproduce

  • If your Bot/App doesn't already have one, have it create a new App-owned Webhook in a Server Text Channel
  • After creating a Webhook, or ensuring your App has one owned by itself, revoke the MANAGE_WEBHOOKS Permission from the App's Bot User
  • Have your App call the GET /webhooks/ endpoint to fetch that same Webhook
  • Observe the result
  • For comparison, have your App call the same GET /webhooks/ endpoint after being re-granted the MANAGE_WEBHOOKS Server Permission

In my case, I was using DJS's <Client>.fetchWebhook(webhookId) method (so without specifying a Webhook Token), which calls the GET /webhooks/{webhookId} endpoint, and so not using the GET /webhooks/{webhookId}/{webhookToken}/ endpoint.

Expected Behavior

The App/Bot would be able to fetch it's own Webhooks that it has made itself without needing the MANAGE_WEBHOOKS Permission.

Current Behavior

Attempting to call the GET /webhooks/ endpoint, without the App/Bot having the MANAGE_WEBHOOKS Permission in the relevant Server/Channel, results in a "Missing Permissions" error being returned.

Screenshots/Videos

No response

Client and System Information

  • Discord.JS v14.14.1
  • NodeJS 20.9.0
  • Tried on both with the Bot being hosted on a local Windows 10 device, and a Ubuntu/Linux VPS.
@yonilerner yonilerner added the synced Synced to internal tracker label Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug synced Synced to internal tracker
Projects
None yet
Development

No branches or pull requests

2 participants