Ability to create message using the API but not as a bot #5158
-
Hi! I've got a Discord application where I authenticated via OAuth2 with a redirect URI, got a bearer token, and can make API requests. However, it's hard to tell which API requests require a bot versus just the regular bearer token I have. I'm specifically trying to send a direct message via the API to a particular server I belong to, which is something I can do personally in the Discord app, but which I can't seem to do programmatically via the Discord API. Here's an example request that gives me a 401 response: curl -X 'POST' -d '{"content":"hello world","tts":false}' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer my_access_token' \
-H 'Content-Type: application/json' \
-H 'User-Agent: my_app' 'https://discord.com/api/v10/channels/some_channel_or_recipient_id/messages' I've been referencing https://discord.com/developers/docs/resources/channel#create-message. Even just doing a simple 'get channel' request for a channel on a server I belong to, or for a DM I'm in, fails with a 401 response. I can't turn my app into a bot because I don't admin the server I'm trying to interact with, I just want a way to programmatically take the same actions as I can personally. Some API endpoints such as https://discord.com/developers/docs/resources/user#get-current-user-guild-member work fine with my bearer token.
|
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 4 replies
-
All endpoints that can be used with oauth are listed in the oauth table and have a "requires x scope" in the endpoint description. Pretry much all other endpoints require a bot token What you're asking is basically selfbotting (automating your user account) which is against the tos |
Beta Was this translation helpful? Give feedback.
-
It's assumed that all endpoints are bot only unless they are listed/linked on the oauth2 scopes list. |
Beta Was this translation helpful? Give feedback.
-
@cheshire137 is there any update on this now? Or still we cannot do it? Please let me know if you have any information regarding this. |
Beta Was this translation helpful? Give feedback.
-
Would it be possible for discord to allow a bot to respond to an interaction with a message that it wishes to send instead of the user, and the user has to confirm whether he authorizes the bot to write this message for him? This could be very useful when using pre-defined responses in tickets. Example:
To reduce friction, we could imagine that the member could give temporary or definitive consent via a "Always authorize this bot" box. This would authorize the bot to send a single message as the user, when performing future interactions. |
Beta Was this translation helpful? Give feedback.
All endpoints that can be used with oauth are listed in the oauth table and have a "requires x scope" in the endpoint description. Pretry much all other endpoints require a bot token
What you're asking is basically selfbotting (automating your user account) which is against the tos