File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change 1+ import 'package:mineral/api.dart' ;
2+
3+ void main (_, dynamic port) async {
4+ final client = ClientBuilder ()
5+ .setHmrDevPort (port)
6+ .setIntent (Intent .allNonPrivileged)
7+ .build ();
8+
9+ // Simple command - just 4 lines!
10+ client.commands.declare ((cmd) => cmd
11+ ..setName ('hello' )
12+ ..setDescription ('Say hello' )
13+ ..setHandle (
14+ (ctx) {
15+ final message = MessageBuilder .text ('👋 Hello from Mineral!' );
16+
17+ final mineralLinkButton = Button .link (
18+ 'https://mineral-dart.dev/' ,
19+ emoji: PartialEmoji .fromUnicode ('📘' ),
20+ label: 'Check our documentation' ,
21+ );
22+ message.addButton (mineralLinkButton);
23+
24+ return ctx.interaction.reply (
25+ builder: message,
26+ );
27+ },
28+ ));
29+
30+ await client.init ();
31+ }
You can’t perform that action at this time.
0 commit comments