richfromm / slack2discord

A Discord client that imports Slack-exported JSON chat history to Discord channel(s).
GNU General Public License v3.0
8 stars 3 forks source link

Deal with discord embed limits #30

Open richfromm opened 1 year ago

richfromm commented 1 year ago

I am limiting https://github.com/richfromm/slack2discord/issues/29 (which is the underlying issue that caused the filing of https://github.com/richfromm/slack2discord/issues/25) to deal with just the Discord limit on the number of characters within the text of a message, which is 2000 for free users.

But according to https://www.itgeared.com/what-is-the-character-limit-on-discord/ , there are other issues related to embed's, and this issue is for dealing with them. For our purposes, embed's originate as links within Slack messages, which Slack calls "attachments". (What I call actual attachments, Slack calls "files".)

I think we should deal with the following character limits:

Unlike the case of exceeding the limit on actual message text, I think in these cases it's probably fine to truncate and add something like ... to indicate the truncation.

There are some other character limits described, but I'm not sure if all of them are applicable for us, and/or worth worrying about. But I'm not entirely positive. Like do the URLs count as part of the 6000 character total limit?

There is one other limit that we are already accounting for, which is a max of 10 embed's per message. Currently we're dealing with this by just truncating the list. Which is a little lame, although since the links still actually appear within the text (just not the previews), maybe it's okay? I will consider dealing with this as part of this issue, or maybe not and/or break out as another issue. One possible way is to create one or more blank messages just for the purpose of the extra embed's, although that has the same caveats in terms of dealing with threading as expressed at the end of https://github.com/richfromm/slack2discord/issues/29#issuecomment-1421284279

Attn: @shmulvad

shmulvad commented 1 year ago

One possible way is to create one or more blank messages just for the purpose of the extra embeds

I think what you suggest is a reasonable solution. For most cases, it will probably be fairly rare anyway that 10 embeds per message is exceeded.