discord.py icon indicating copy to clipboard operation
discord.py copied to clipboard

Webhook.send voice_message param

Open nmsturcke opened this issue 1 year ago • 4 comments

Summary

Implement a voice_message field in Webhook.send that passes the MessageFlags.voice flag and converts the file sent into a voice message.

Checklist

  • [x] If code changes were made then they have been tested.
    • [x] I have updated the documentation to reflect the changes.
  • [ ] This PR fixes an issue.
  • [x] This PR adds something new (e.g. new method or parameters).
  • [ ] This PR is a breaking change (e.g. methods or parameters removed/renamed)
  • [ ] This PR is not a code change (e.g. documentation, README, ...)

Additional Information

Although this same method is used for replying to Interactions, due to a known issue in the Discord API, message flags are dropped in webhooks that reply to command contexts. Nothing can be done about it, other than waiting for Discord to fix it.

Media

84Rm4 gSm8h

nmsturcke avatar Jun 21 '23 19:06 nmsturcke

You did a great job! By the way, how to let the bot send a voice message to a specific channel?

grueyg avatar Oct 12 '23 08:10 grueyg

You did a great job! By the way, how to let the bot send a voice message to a specific channel?

Thanks! Bots can't currently send voice messages, only webhooks. So, if you're using my fork, you can create a webhook and use that to send a voice message.

nmsturcke avatar Oct 12 '23 12:10 nmsturcke

You did a great job! By the way, how to let the bot send a voice message to a specific channel?

Thanks! Bots can't currently send voice messages, only webhooks. So, if you're using my fork, you can create a webhook and use that to send a voice message.

Thank you for your reply! I am using your fork and found that the audio file sent by the webhook only appears as a voice message on the discord web page and desktop client, but is still an attachment on the mobile app. Is this the official update by discord to block this feature?

grueyg avatar Oct 12 '23 18:10 grueyg

but is still an attachment on the mobile app

Oh.. My guess is the mobile app is just outdated (as per usual), but not sure.

nmsturcke avatar Oct 13 '23 08:10 nmsturcke