discord / discord-api-docs

Official Discord API Documentation
https://discord.com/developers/docs/intro
Other
5.95k stars 1.26k forks source link

Height and Width tags do nothing #5871

Closed huths0lo closed 1 year ago

huths0lo commented 1 year ago

Description

The discord api documentation here mentions height and width tags. These tags do not appear to do anything. Whether I place them within the image array, or the embed array, it makes no difference. Others have stated that the height and width cannot be changed; which makes no sense, considering the tags exist. If thats true, its highly limiting.

Steps to Reproduce

payload with height/width in image array {

"content": "Test Image Sizing",
"embeds": [{
    "color": "16776960",
    "image": {
        "url": "https://ipfs.io/ipfs/QmWj3Byf9r3HkW5jqtPSyXW1TGfct2Q8DhQQoFzffRFNrp",
        "height": 32,
        "width": 32
    }
}]

}

payload with height/width in embeds array {

"content": "Test Image Sizing",
"embeds": [{
    "color": "16776960",
    "height": 32,
    "width": 32,
    "image": {
        "url": "https://ipfs.io/ipfs/QmWj3Byf9r3HkW5jqtPSyXW1TGfct2Q8DhQQoFzffRFNrp"

    }
}]

}

Expected Behavior

Should size the image to 32x32 pixels

Current Behavior

Renders at the default size of 200x200

Screenshots/Videos

image

Client and System Information

Posting from within Ubuntu 22.04 using python requests.

`payload ={

"content": "Test Image Sizing",
"embeds": [{
    "color": "16776960",
    "image": {
        "url": "https://ipfs.io/ipfs/QmWj3Byf9r3HkW5jqtPSyXW1TGfct2Q8DhQQoFzffRFNrp",
        "height": 32,
        "width": 32
    }
}]

}

API_ENDPOINT = 'https://discord.com/api/v10'

discord_channel = 1066405020586741870 url = f"{API_ENDPOINT}/channels/{discord_channel}/messages" payload["access_token"] = current_token auth_token = f'Bot {bot_secret}' headers = { "Authorization" : auth_token, "Content-Type": "application/json" } requests.post(url=url, headers=headers, json=payload, timeout=10)`

AEnterprise commented 1 year ago

You can't set these properties, as mentioned on the create messages endpoint documentation

For the embed object, you can set every field except type (it will be rich regardless of if you try to set it), provider, video, and any height, width, or proxy_url values for images. https://discord.com/developers/docs/resources/channel#create-message