Content-Length: 272467 | pFad | http://github.com/interactions-py/interactions.py/issues/1734

41 [BUG] Webhook cannot execute stickers · Issue #1734 · interactions-py/interactions.py · GitHub
Skip to content

[BUG] Webhook cannot execute stickers #1734

Open
@retr0-init

Description

@retr0-init

Library Version

5.13.1

Describe the Bug

The discord webhook execution API does not contain the sticker field according to https://discord.com/developers/docs/resources/webhook#execute-webhook-jsonform-params.

Steps to Reproduce

  1. Create a custom sticker
  2. Execute the following code to send the sticker with webhook

Expected Results

It complains empty content sent with webhook

Minimal Reproducible Code

class TemplateCog(interactions.Extension):
    @interactions.slash_command(
        "test", description="test command", scopes=[DEV_GUILD] if DEV_GUILD else None
    )
    async def test_cmd(self, ctx: interactions.SlashContext):
        """Register as an extension command"""
        a = await ctx.channel.fetch_webhooks()
        sticker = await ctx.guild.fetch_all_custom_stickers()
        await a[0].send(username="ABCDEFG", avatar_url=ctx.author.avatar_url, stickers=sticker)

Traceback

Traceback (most recent call last):
  File "venv/lib/python3.11/site-packages/interactions/client/client.py", line 2018, in __dispatch_interaction
    response = await callback
               ^^^^^^^^^^^^^^
  File "venv/lib/python3.11/site-packages/interactions/client/client.py", line 1886, in _run_slash_command
    return await command(ctx, **ctx.kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "venv/lib/python3.11/site-packages/interactions/models/internal/command.py", line 132, in __call__
    await self.call_callback(self.callback, context)
  File "venv/lib/python3.11/site-packages/interactions/models/internal/application_commands.py", line 841, in call_callback
    return await self.call_with_binding(callback, ctx)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "venv/lib/python3.11/site-packages/interactions/models/internal/callback.py", line 44, in call_with_binding
    return await callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "extensions/template.py", line 26, in test_cmd
    await ctx.send(f"{ctx.channel.name}")
  File "venv/lib/python3.11/site-packages/interactions/models/discord/webhooks.py", line 255, in send
    message_data = await self._client.http.execute_webhook(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "venv/lib/python3.11/site-packages/interactions/api/http/http_requests/webhooks.py", line 150, in execute_webhook
    return await self.request(
           ^^^^^^^^^^^^^^^^^^^
  File "venv/lib/python3.11/site-packages/interactions/api/http/http_client.py", line 467, in request
    await self._raise_exception(response, route, result)
  File "venv/lib/python3.11/site-packages/interactions/api/http/http_client.py", line 488, in _raise_exception
    raise HTTPException(response, response_data=result, route=route)
interactions.client.errors.HTTPException: HTTPException: 400|Bad Request || Cannot send an empty message

Checklist

  • I have searched the open issues for duplicates.
  • I have shown the entire traceback, if possible.
  • I have removed my token from display, if visible.
  • I have attempted to debug this myself, and I believe this issue is with the library

Additional Information

https://discord.com/developers/docs/resources/webhook#execute-webhook-jsonform-params

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions









      ApplySandwichStrip

      pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


      --- a PPN by Garber Painting Akron. With Image Size Reduction included!

      Fetched URL: http://github.com/interactions-py/interactions.py/issues/1734

      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy