Giter Site home page Giter Site logo

muhammad-safaras's People

Contributors

domsbrother avatar

Watchers

 avatar

muhammad-safaras's Issues

Error code 50025 occurs when the access_token provided is either missing or is invalid.9090

Error code 50025 occurs when the access_token provided is either missing or is invalid.
A token can be invalid when it is provided for the wrong application or wrong user. Access tokens are specific to a user or an application, so when attempting to add a user to a guild using an access token you need a unique token for each user you are attempting to add.

This is all the information I can provide without having more context.
As a note, missing scopes is 50026, so that definitely isn't the problem.

Originally posted by @DV8FromTheWorld in discord/discord-api-docs#5578 (comment)

### Description

Description

Sending message components with a non-application-owned Webhook results in a success response instead of an error response. This incorrectly communicates to the user that the request was valid, even though the request was in fact not valid. Resulting messages always contain empty components, with other fields in-tact. The documentation should reflect this behavior if intentional.

Sending Content and Components

Sending the following payload

{
    "content": "Test",
    "components": [
        {
            "type": 1,
            "components": [
                {
                    "type": 2,
                    "label": "Test",
                    "custom_id": "test",
                    "style": 1,
                }
            ]
        }
    ]
}

Results in the following message payload being created

{
	"id": "[redacted]",
	"type": 0,
	"content": "Test",
	"channel_id": "[redacted]",
	"author": {
		"bot": true,
		"id": "[redacted]",
		"username": "Test",
		"avatar": null,
		"discriminator": "0000"
	},
	"attachments": [],
	"embeds": [],
	"mentions": [],
	"mention_roles": [],
	"pinned": false,
	"mention_everyone": false,
	"tts": false,
	"timestamp": "2022-12-12T22:20:09.994000+00:00",
	"edited_timestamp": null,
	"flags": 0,
	"components": [],
	"webhook_id": "[redacted]"
}

Sending Only Components

Specifying only message components via the following

{
    "components": [
        {
            "type": 1,
            "components": [
                {
                    "type": 2,
                    "label": "Test",
                    "custom_id": "test",
                    "style": 1
                }
            ]
        }
    ]
}

Results in the following empty message being created

{
	"id": "[redacted]",
	"type": 0,
	"content": "",
	"channel_id": "[redacted]",
	"author": {
		"bot": true,
		"id": "[redacted]",
		"username": "Test",
		"avatar": null,
		"discriminator": "0000"
	},
	"attachments": [],
	"embeds": [],
	"mentions": [],
	"mention_roles": [],
	"pinned": false,
	"mention_everyone": false,
	"tts": false,
	"timestamp": "2022-12-12T22:24:42.271000+00:00",
	"edited_timestamp": null,
	"flags": 0,
	"components": [],
	"webhook_id": "[redacted]"
}

Steps to Reproduce

  1. Send the following cURL with content and components specified
curl --request POST \
  --url 'https://discord.com/api/v10/webhooks/<webhook_id>/<webhook_token>?wait=true' \
  --header 'content-type: application/json' \
  --data '{
    "components": [
        {
            "type": 1,
            "components": [
                {
                    "type": 2,
                    "label": "Test",
                    "custom_id": "test",
                    "style": 1
                }
            ]
        }
    ]
}'
  1. Receive an HTTP 200 response with content, but empty components, embeds, and attachments

  2. Send the following cURL with only components specified

curl --request POST \
  --url 'https://discord.com/api/v10/webhooks/<webhook_id>/<webhook_token>?wait=true' \
  --header 'content-type: application/json' \
  --data '{
    "components": [
        {
            "type": 1,
            "components": [
                {
                    "type": 2,
                    "label": "Test",
                    "custom_id": "test",
                    "style": 1
                }
            ]
        }
    ]
}'
  1. Receive an HTTP 200 response with content, components, embeds, and attachments all being empty

Expected Behavior

Receive an HTTP 400 Bad Request error response due to sending components from a non-app-owned webhook

Current Behavior

Receive an HTTP 200 OK success response instead, with components always being empty

Screenshots/Videos

No response

Client and System Information

HTTP Client: Insomnia 2022.6.0
OS: Windows 10 Pro 64bit, version 22H2

Originally posted by @CheesyGamer77 in discord/discord-api-docs#5744

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.