kurzgesagt-in-a-nutshell / birdbot

A multipurpose bot for the kurzgesagt discord server
GNU General Public License v3.0
22 stars 5 forks source link

[Feature]: Limit checks for embed #182

Open Utkarsh-Patel-13 opened 11 months ago

Utkarsh-Patel-13 commented 11 months ago

Discord Contact Details

389718094270038018

Title

Adding various limit checks for embed.

What problem does this address?

Embeds have the following limits:

FIELD LIMIT
total embed length 6000 characters
title 256 characters
description 4096 characters
fields Up to 25 field objects
field.name 256 characters
field.value 1024 characters
footer.text 2048 characters
author.name 256 characters

None of the discord.Embeds in the codebase has these checks. These checks are crucial for long embeds like Infractions.

How would this solve the problem?

Possible Solutions:

arcinfini commented 4 months ago

If implemented correctly this would solve #143 and #185.

I'd advocate for a flexible global helper for embeds. Preferably a class that inherits from the discord.Embed. Initial class implementation is the challenge there, but it would be easier to fix in areas where embeds are used.