Skip to content

Commit c813c63

Browse files
committed
readme with message builder
1 parent b94f6be commit c813c63

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,36 @@ var app = new AppBuilder()
6666
await 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(0x5865F2)
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

0 commit comments

Comments
 (0)