需自备 Discord Bot Token 才能连接网关;示例使用 GatewayIntents.allUnprivileged,需要特权意图的功能要另行申请并开启

nyxx
nyxx-discordApache-2.0活跃维护用 Dart 封装 Discord API 的客户端库,方便开发者快速构建 Discord 机器人和集成应用,省去手动处理底层 HTTP 与网关细节。
Wrapper around Discord API for Dart
Dart 编写的 Discord API 封装库,帮你快速写机器人和应用
用 Dart 封装 Discord API 的客户端库,方便开发者快速构建 Discord 机器人和集成应用,省去手动处理底层 HTTP 与网关细节。
核心能力
- 用 Nyxx.connectGateway 一行连上网关
- 监听 onMessageCreate 事件处理消息
- 内置 MessageBuilder 构造并回复消息
- 配套 commands、extensions、lavalink 扩展包
容易踩的坑
- v6.9.16.9.1最新正式版2026-08-10 · 2026-08-10 16:08 UTC
What's Changed
- Update documentation links to nyxx.org by @abitofevrything in https://github.com/nyxx-discord/nyxx/pull/784
- Fix 6.9.0+1 release by @abitofevrything in https://github.com/nyxx-discord/nyxx/pull/785
- bug: Fix channel tag parsing by @l7ssha in https://github.com/nyxx-discord/nyxx/pull/786
Full Changelog: https://github.com/nyxx-discord/nyxx/compare/v6.9.0...v6.9.1
- v6.9.0+16.9.0+12026-05-30 · 2026-05-30 11:33 UTC
查看更新说明
What's Changed
- Update documentation links to nyxx.org by @abitofevrything in https://github.com/nyxx-discord/nyxx/pull/784
- Fix 6.9.0+1 release by @abitofevrything in https://github.com/nyxx-discord/nyxx/pull/785
Full Changelog: https://github.com/nyxx-discord/nyxx/compare/v6.9.0...v6.9.0+1
- v6.9.06.9.02026-05-05 · 2026-05-05 09:30 UTC
查看更新说明
What's Changed
- Add support for zstd compression by @abitofevrything in https://github.com/nyxx-discord/nyxx/pull/695
- Improve error handling by @abitofevrything in https://github.com/nyxx-discord/nyxx/pull/774
- Add topics to documentation by @abitofevrything in https://github.com/nyxx-discord/nyxx/pull/775
- Only select zstd transport by default if it is available by @abitofevrything in https://github.com/nyxx-discord/nyxx/pull/777
- Implement several API updates by @abitofevrything in https://github.com/nyxx-discord/nyxx/pull/776
- Update release and test workflows by @abitofevrything in https://github.com/nyxx-discord/nyxx/pull/778
- Fixup doc directory name by @abitofevrything in https://github.com/nyxx-discord/nyxx/pull/779
- Deprecate RoleNotFoundException by @abitofevrything in https://github.com/nyxx-discord/nyxx/pull/780
- add more attachment flags and fields by @Lexedia in https://github.com/nyxx-discord/nyxx/pull/739
- Release/6.9.0 by @abitofevrything in https://github.com/nyxx-discord/nyxx/pull/781
Full Changelog: https://github.com/nyxx-discord/nyxx/compare/6.8.1...v6.9.0
- nyxx-6.8.16.8.12026-02-01 · 2026-02-01 14:36 UTC
这个版本没有写更新说明。
- nyxx-6.8.06.8.02026-01-23 · 2026-01-23 20:43 UTC
查看更新说明
What's Changed
- Don't throw Futures in CdnAsset.fetchStreamed by @abitofevrything in https://github.com/nyxx-discord/nyxx/pull/752
- Resolve some documentation warnings by @abitofevrything in https://github.com/nyxx-discord/nyxx/pull/754
- Reduce the number of managers present in the process's memory by @abitofevrything in https://github.com/nyxx-discord/nyxx/pull/753
- Add some tooling scripts by @Lexedia in https://github.com/nyxx-discord/nyxx/pull/755
- support new pin endpoint by @Lexedia in https://github.com/nyxx-discord/nyxx/pull/756
bannerHashis now serialised in a user guild by @Lexedia in https://github.com/nyxx-discord/nyxx/pull/758- support guest invites by @Lexedia in https://github.com/nyxx-discord/nyxx/pull/757
- add user guild tags by @Lexedia in https://github.com/nyxx-discord/nyxx/pull/733
- Implement new modals by @abitofevrything in https://github.com/nyxx-discord/nyxx/pull/762
- ignore tools and test directories when publishing by @Lexedia in https://github.com/nyxx-discord/nyxx/pull/760
- add role gradient colors by @Lexedia in https://github.com/nyxx-discord/nyxx/pull/759
- Implement phase 2 of modals v2 by @abitofevrything in https://github.com/nyxx-discord/nyxx/pull/764
- fixes
TextEmojiequality by @Lexedia in https://github.com/nyxx-discord/nyxx/pull/766 - make
UserPrimaryGuildproperties nullable by @Lexedia in https://github.com/nyxx-discord/nyxx/pull/767 - file upload component by @WWology in https://github.com/nyxx-discord/nyxx/pull/768
- Update cache even with no listeners by @abitofevrything in https://github.com/nyxx-discord/nyxx/pull/770
- Implement modals v2 phase 4 by @abitofevrything in https://github.com/nyxx-discord/nyxx/pull/769
- Release 6.8.0 by @abitofevrything in https://github.com/nyxx-discord/nyxx/pull/771
New Contributors
- @WWology made their first contribution in https://github.com/nyxx-discord/nyxx/pull/768
Full Changelog: https://github.com/nyxx-discord/nyxx/compare/nyxx-6.7.0...nyxx-6.8.0
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
nyxx
A complete, robust and efficient wrapper around Discord's API for bots & applications.
To get started using nyxx, follow our getting started guide to write your first bot.
If you're already familiar with Discord's API, here's a quick example to get you started:
import 'package:nyxx/nyxx.dart';
void main() async {
final client = await Nyxx.connectGateway('<TOKEN>', GatewayIntents.allUnprivileged);
final botUser = await client.users.fetchCurrentUser();
client.onMessageCreate.listen((event) async {
if (event.mentions.contains(botUser)) {
await event.message.channel.sendMessage(MessageBuilder(
content: 'You mentioned me!',
referencedMessage: MessageReferenceBuilder.reply(messageId: event.message.id),
));
}
});
}
Other nyxx packages
- nyxx_commands: A command framework for handling both simple & complex commands.
- nyxx_extensions: Pagination, emoji utilities and other miscellaneous helpers for developing bots using nyxx.
- nyxx_lavalink: Lavalink support for playing audio in voice channels.
More examples
- More examples can be found in our GitHub repository here.
- Running on Dart is a complete example of a bot written with nyxx.
Additional documentation & help
The API documentation for the latest stable version can be found on pub.
Docs and wiki
Tutorials and wiki articles are hosted here.
Official nyxx Discord server
Our Discord server is where you can get help for any nyxx packages, as well as release announcements and discussions about the library.
Discord API docs
Discord's API documentation details what nyxx implements & provides more detailed explanations of certain topics.
Discord API Server
The unofficial guild for Discord Bot developers. To get help with nyxx check #dart_nyxx channel.
Pub.dev docs
The dartdocs page will always have the documentation for the latest release.
Contributing to Nyxx
Read the contributing document
Credits
- Thanks to Hackzzila's for nyx, the original project nyxx was forked from.
