Files
Discord.Net/docs/guides/components_v2/samples/recipe-servings-modal.cs
Adriaan Waem cf66ab4520 Docs/components v2 :wires: (#3162)
* new pages :3

* fimished intro page

* fimished interaction page

* remove unused shit

* I think we are done lmao

* I lied, fixed some small mistakes

* Update docs/guides/components_v2/interaction.md

Co-authored-by: Mihail Gribkov <61027276+Misha-133@users.noreply.github.com>

* misha quality assurance :3 + breakings pages

* Apply suggestions from code review

Co-authored-by: Mihail Gribkov <61027276+Misha-133@users.noreply.github.com>

* component types guide expanded

* :3

* Apply suggestions from code review

Co-authored-by: Mihail Gribkov <61027276+Misha-133@users.noreply.github.com>

---------

Co-authored-by: Mihail Gribkov <61027276+Misha-133@users.noreply.github.com>
2025-07-18 22:14:24 +03:00

16 lines
441 B
C#

private static ModalBuilder CreateServingsModal(short servings)
{
TextInputBuilder? textInput = new TextInputBuilder()
.WithCustomId(RecipeServingsInput)
.WithLabel("Servings")
.WithValue(servings.ToString())
.WithMinLength(1)
.WithMaxLength(3)
.WithStyle(TextInputStyle.Short);
return new ModalBuilder()
.WithCustomId(RecipeServingsButton)
.WithTitle("Set Servings")
.AddTextInput(textInput);
}