nyxx/README.md

97 lines
3.1 KiB
Markdown
Raw Normal View History

2018-07-01 12:34:01 +02:00
<div align="center">
<br />
2018-10-14 10:30:23 +02:00
<p> <img width="600" src="https://l7ssha.github.io/nyxx0.png" />
2018-07-01 12:34:01 +02:00
<br />
2016-12-05 23:04:50 +01:00
2018-07-01 12:34:01 +02:00
[![Build Status](https://travis-ci.org/l7ssha/nyxx.svg?branch=master)](https://travis-ci.org/l7ssha/nyxx)
[![Pub](https://img.shields.io/pub/v/nyxx.svg)](https://pub.dartlang.org/packages/nyxx)
2018-07-02 18:03:31 +02:00
[![documentation](https://img.shields.io/badge/Documentation-nyxx-yellow.svg)](https://www.dartdocs.org/documentation/nyxx/latest/)
2018-06-17 14:23:17 +02:00
2018-09-15 15:17:12 +02:00
Simple, robust framework for creating discord bots for Dart language. <br />
This repo is fork of [Hackzzila's](https://github.com/Hackzzila) [nyx](https://github.com/Hackzzila/nyx) -
extended with new functionality, rewritten backend, many bug fixes and applied pending pull requests.
2018-06-17 14:23:17 +02:00
2018-07-01 12:34:01 +02:00
<hr />
</div>
2018-08-09 17:37:07 +02:00
### Stable release
2018-09-15 15:17:12 +02:00
Starting from version `1.0.0` of nyxx, library requires `Dart 2.0+`. You can use stable release or dev sdk.
2018-08-09 17:37:07 +02:00
2018-06-17 14:42:44 +02:00
### Features
2018-06-17 14:23:17 +02:00
- **Commands framework included** <br>
A fast way to create a bot with command support. Implementing the framework is simple - and everything is done automatically.
2018-07-30 12:09:40 +02:00
- **Cross Platform** <br>
Nyxx works on the command line, in the browser, and on mobile devices.
2018-07-30 12:09:40 +02:00
- **Fine Control** <br>
Nyxx allows you to control every outgoing HTTP request or WebSocket message.
2018-07-30 12:09:40 +02:00
- **Complete** <br>
Nyxx supports nearly all Discord API endpoints.
2018-07-24 16:26:09 +02:00
### Sample
2018-09-15 15:17:12 +02:00
Basic usage:
```dart
2018-07-24 16:26:09 +02:00
void main() {
discord.Client bot =
new discord.Client(Platform.environment['DISCORD_TOKEN']);
bot.onReady.listen((discord.ReadyEvent e) {
print("Ready!");
});
bot.onMessage.listen((discord.MessageEvent e) {
if (e.message.content == "!ping") {
e.message.channel.sendMessage(content: "Pong!");
}
});
}
```
2016-12-07 04:12:08 +01:00
2018-09-15 15:17:12 +02:00
Commands:
```dart
void main() {
nyxx.Nyxx bot = nyxx.Nyxx(Platform.environment['DISCORD_TOKEN']);
command.CommandsFramework('!', bot)
..admins = [nyxx.Snowflake("302359032612651009")]
..registerLibraryCommands();
}
@command.Command(name: "single")
Future<void> single(command.CommandContext context) async {
await context.reply(content: "WORKING");
}
@command.Module("ping")
class PongCommand extends command.CommandContext {
@command.Command()
@command.Help("Pong!", usage: "ping")
Future<void> run() async {
await reply(content: "Pong!");
}
@command.Command(name: "subcommand")
Future<void> run() async {
await reply(content: "\\cmd");
}
}
```
## Documentation, help and examples
#### [Discord API docs](https://discordapp.com/developers/docs/intro)
Discord API documentation features rich descriptions about all topics that nyxx covers.
#### [Discord API Guild](https://discord.gg/discord-api)
Unofficial guild for Discord Bot developers. To get help with nyxx check `#dart_nyxx` channel.
2016-12-07 04:12:08 +01:00
2018-06-21 20:34:40 +02:00
#### [Dartdocs](https://www.dartdocs.org/documentation/nyxx/latest/)
The dartdocs page will always have the documentation for the latest release.
2018-06-19 21:42:01 +02:00
2018-10-27 20:59:58 +02:00
#### [Dev docs](https://l7ssha.github.io/nyxx)
You can read about upcoming changes to the library on my website.
2018-06-17 20:54:34 +02:00
#### [Wiki](https://github.com/l7ssha/nyxx/wiki)
2018-09-04 21:39:03 +02:00
Wiki documentation are designed to match the latest Nyxx release.