1
1
# nyxx_lavalink
2
2
3
- [ ![ pub] ( https://img.shields.io/pub/v/nyxx_lavalink.svg )] ( https://pub.dartlang.org/packages/nyxx_lavalink )
4
- [ ![ documentation] ( https://img.shields.io/badge/Documentation-nyxx_lavalink-yellow.svg )] ( https://www.dartdocs.org/documentation/nyxx_lavalink/latest/ )
3
+ [ ![ Discord Shield] ( https://discordapp.com/api/guilds/846136758470443069/widget.png?style=shield )] ( https://discord.gg/nyxx )
4
+ [ ![ pub] ( https://img.shields.io/pub/v/nyxx.svg )] ( https://pub.dartlang.org/packages/nyxx_lavalink )
5
+ [ ![ documentation] ( https://img.shields.io/badge/Documentation-nyxx_interactions-yellow.svg )] ( https://www.dartdocs.org/documentation/nyxx_lavalink/latest/ )
5
6
6
7
Simple, robust framework for creating discord bots for Dart language.
7
8
8
9
<hr />
9
10
10
11
### Features
11
12
12
- - ** Slash commands support** <br >
13
- Supports and provides easy API for creating and handling slash commands
14
- - ** Commands framework included** <br >
15
- A fast way to create a bot with command support. Implementing the framework is simple - and everything is done automatically.
16
13
- ** Lavalink support** <br >
17
14
Nyxx allows you to create music bots by adding support to [ Lavalink] ( https://github.com/freyacodes/Lavalink ) API
18
- - ** Cross Platform** <br >
19
- Nyxx works on the command line, in the browser, and on mobile devices.
20
15
- ** Fine Control** <br >
21
16
Nyxx allows you to control every outgoing HTTP request or WebSocket message.
22
- - ** Complete** <br >
23
- Nyxx supports nearly all Discord API endpoints.
24
-
25
17
26
18
## Quick example
27
19
28
- Basic usage:
29
- ``` dart
30
- void main() {
31
- final bot = Nyxx("TOKEN", GatewayIntents.allUnprivileged);
32
-
33
- bot.onMessageReceived.listen((event) {
34
- if (event.message.content == "!ping") {
35
- event.message.channel.sendMessage(MessageBuilder.content("Pong!"));
36
- }
37
- });
38
- }
39
- ```
40
-
41
- Slash commands:
42
- ``` dart
43
- void main() {
44
- final bot = Nyxx("<%TOKEN%>", GatewayIntents.allUnprivileged);
45
- Interactions(bot)
46
- ..registerSlashCommand(
47
- SlashCommandBuilder("hi", "This is example slash command", [])
48
- ..registerHandler((event) async {
49
- await event.acknowledge();
50
-
51
- await event.respond(MessageBuilder.content("Hello World!"));
52
- })
53
- );
54
- }
55
- ```
56
-
57
- Commands:
58
- ``` dart
59
- void main() {
60
- final bot = Nyxx("TOKEN", GatewayIntents.allUnprivileged);
61
-
62
- Commander(bot, prefix: "!!!")
63
- ..registerCommand("ping", (context, message) => context.reply(MessageBuilder.content("Pong!")));
64
- }
65
- ```
66
-
67
20
Lavalink
68
21
``` dart
69
22
void main() async {
70
- final bot = Nyxx("TOKEN", GatewayIntents.allUnprivileged);
23
+ final bot = NyxxFactory.createNyxxWebsocket("<TOKEN>", GatewayIntents.allUnprivileged);
24
+
71
25
final guildId = Snowflake("GUILD_ID");
72
26
final channelId = Snowflake("CHANNEL_ID");
73
-
74
- final cluster = Cluster(bot, Snowflake("BOT_ID"));
75
-
27
+
28
+ final cluster = ICluster.createCluster(bot, Snowflake("BOT_ID"));
76
29
await cluster.addNode(NodeOptions());
77
-
78
- bot.onMessageReceived.listen((event) async {
30
+
31
+ bot.eventsWs. onMessageReceived.listen((event) async {
79
32
if (event.message.content == "!join") {
80
- final channel = await bot.fetchChannel<VoiceGuildChannel >(channelId);
33
+ final channel = await bot.fetchChannel<IVoiceGuildChannel >(channelId);
81
34
82
35
cluster.getOrCreatePlayerNode(guildId);
83
-
36
+
84
37
channel.connect();
85
38
} else {
86
39
final node = cluster.getOrCreatePlayerNode(guildId);
@@ -93,44 +46,45 @@ void main() async {
93
46
}
94
47
```
95
48
96
- ## More examples
97
-
98
- Nyxx examples can be found [ here] ( https://github.com/l7ssha/nyxx/tree/dev/nyxx/example ) .
49
+ ## Other nyxx packages
99
50
100
- Commander examples can be found [ here] ( https://github.com/l7ssha/nyxx/tree/dev/nyxx_commander/example )
51
+ - [ nyxx] ( https://github.com/nyxx-discord/nyxx )
52
+ - [ nyxx_interactions] ( https://github.com/nyxx-discord/nyxx_interactions )
53
+ - [ nyxx_extensions] ( https://github.com/nyxx-discord/nyxx_extensions )
54
+ - [ nyxx_commander] ( https://github.com/nyxx-discord/nyxx_commander )
55
+ - [ nyxx_pagination] ( https://github.com/nyxx-discord/nyxx_pagination )
101
56
102
- Slash commands (interactions) examples can be found [ here ] ( https://github.com/l7ssha/nyxx/tree/dev/nyxx_interactions/example )
57
+ ## More examples
103
58
104
- Lavalink examples can be found [ here] ( https://github.com/l7ssha/ nyxx/ tree/dev/nyxx_lavalink/ example )
59
+ Nyxx examples can be found [ here] ( https://github.com/nyxx-discord/nyxx_lavalink/ tree/dev/example ) .
105
60
106
61
### Example bots
107
62
- [ Running on Dart] ( https://github.com/l7ssha/running_on_dart )
108
- - [ Lavalink testbot] ( https://github.com/AlvaroMS25/nyxx_lavalink_testbot )
109
63
110
64
## Documentation, help and examples
111
65
112
- ** Dartdoc documentation is hosted on [ pub] ( https://www.dartdocs.org/documentation/nyxx/latest/ ) .
113
- This wiki just fills gap in docs with more descriptive guides and tutorials.**
66
+ ** Dartdoc documentation for latest stable version is hosted on [ pub] ( https://www.dartdocs.org/documentation/nyxx_lavalink/latest/ ) **
67
+
68
+ #### [ Docs and wiki] ( https://nyxx.l7ssha.xyz )
69
+ You can read docs and wiki articles for latest stable version on my website. This website also hosts docs for latest
70
+ dev changes to framework (` dev ` branch)
71
+
72
+ #### [ Official nyxx discord server] ( https://discord.gg/nyxx )
73
+ If you need assistance in developing bot using nyxx you can join official nyxx discord guild.
114
74
115
75
#### [ Discord API docs] ( https://discordapp.com/developers/docs/intro )
116
76
Discord API documentation features rich descriptions about all topics that nyxx covers.
117
77
118
78
#### [ Discord API Guild] ( https://discord.gg/discord-api )
119
79
The unofficial guild for Discord Bot developers. To get help with nyxx check ` #dart_nyxx ` channel.
120
80
121
- #### [ Dartdocs] ( https://www.dartdocs.org/documentation/nyxx /latest/ )
81
+ #### [ Dartdocs] ( https://www.dartdocs.org/documentation/nyxx_lavalink /latest/ )
122
82
The dartdocs page will always have the documentation for the latest release.
123
83
124
- #### [ Dev docs] ( https://nyxx.l7ssha.xyz )
125
- You can read about upcoming changes in the library on my website.
126
-
127
- #### [ Wiki] ( https://github.com/l7ssha/nyxx/wiki )
128
- Wiki documentation are designed to match the latest Nyxx release.
129
-
130
84
## Contributing to Nyxx
131
85
132
- Read [ contributing document] ( https://github.com/l7ssha/nyxx /blob/development/CONTRIBUTING.md )
86
+ Read [ contributing document] ( https://github.com/l7ssha/nyxx_lavalink /blob/development/CONTRIBUTING.md )
133
87
134
- ## Credits
88
+ ## Credits
135
89
136
- * [ Hackzzila's] ( https://github.com/Hackzzila ) for [ nyx] ( https://github.com/Hackzzila/nyx ) .
90
+ * [ Hackzzila's] ( https://github.com/Hackzzila ) for [ nyx] ( https://github.com/Hackzzila/nyx ) .
0 commit comments