SinisterRectus / Discordia

Discord API library written in Lua for the Luvit runtime environment
MIT License
697 stars 143 forks source link

Use new `embeds` field for messages and allow multiple embeds. #339

Closed Lyrth closed 1 year ago

Lyrth commented 2 years ago

Use the new embeds field for sending messages since embed is now deprecated (see below), and allow sending multiple embeds in one message by specifying embeds in TextChannel:send. Specifying embed in the send method still works for compatibility, embeds will take precedence if it's a non-empty array.

( from: https://discord.com/developers/docs/change-log#june-10-2021 )

Message routes now accept an embeds array in addition to the existing embed field. Bots can now send up to 10 embeds per message, to be consistent with webhook behavior. The existing embed field is considered deprecated and will be removed in the next API version.

RiskoZoSlovenska commented 2 years ago

Perhaps it would be a good idea to support both the embed and embeds fields (at least from a user point of view), so that if both are present, the value of embed gets added to the embeds table. That's how 3.0 does it.