File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -66,6 +66,36 @@ var app = new AppBuilder()
6666await app .RunAsync ();
6767```
6868
69+ ### Exemplo com Message Builders
70+
71+ ``` csharp
72+ using Disc .NET .Client .SDK .Messages .Components .Buttons ;
73+ using Disc .NET .Commands ;
74+ using Disc .NET .Commands .MessageBuilders ;
75+
76+ [SlashCommand (" ping" , InteractionType .ApplicationCommand , " Testa a latência" )]
77+ public class PingCommand : ISlashCommand
78+ {
79+ public async Task RunAsync (InteractionContext context , CancellationToken ct = default )
80+ {
81+ var message = new MessageBuilder ()
82+ .WithContent (" Hello World!" )
83+ .WithEmbed (embed => embed
84+ .SetTitle (" Pong!" )
85+ .SetDescription (" Exemplo de mensagem usando builders." )
86+ .SetColor (0x 5865F2 )
87+ .AddField (" Status" , " Online" , true ))
88+ .WithActionRow (
89+ new ActionRowBuilder ()
90+ .AddButton (" Atualizar" , " ping_refresh" , ButtonStyle .Primary )
91+ .AddLinkButton (" Repositório" , " https://github.com/dridev/Disc.NET" ))
92+ .Build ();
93+
94+ await context .Response .SendMessageAsync (message , ct );
95+ }
96+ }
97+ ```
98+
6999---
70100
71101## 📦 Módulos Atuais
You can’t perform that action at this time.
0 commit comments