Discord.Net icon indicating copy to clipboard operation
Discord.Net copied to clipboard

Fix placeholder length being hardcoded

Open gepbird opened this issue 3 years ago • 2 comments

When the developer assigns a string to a TextInputBuilder.Placeholder, its length is checked against a hardcoded value. Extracting it out to a public variable makes it more consistent with the codebase and the developer can check if the placeholder is too long without having to hardcode it.

gepbird avatar Aug 07 '22 22:08 gepbird

..... It's done this way because it's a discord restriction

SylveonDeko avatar Aug 07 '22 22:08 SylveonDeko

..... It's done this way because it's a discord restriction

@Pusheon

I don't understand that. Discord restricts placeholder length to maximum 100 characters, what does it have to do with not extracting it to a variable? In SelectMenuBuilder it is extracted.

gepbird avatar Aug 07 '22 22:08 gepbird

@Pusheon it doesn't matter if it's a Discord limit or a DNet limit. the purpose of this PR is the make the hardcoded value accessible to developers so they can check input lengths on their side without also hardcoding the value in their code (which would cause issues if it ever changed in DNet).

MrCakeSlayer avatar Aug 15 '22 17:08 MrCakeSlayer