Skip to content

Commit

Permalink
update 2.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
NeutronStars committed Sep 23, 2017
1 parent e9906b5 commit 2da4d9e
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ N-Bot API is an __*open-source project*__ using **JDA** which will allow you **c

For use it download the [latest release](https://github.com/NeutronStars/N-Bot/releases) and execute the following command `java -jar N-Bot-VERSION-withDependencies-JDA-VERSION.jar` a **config** folder will appear who contains an **config.json** file. Open it and insert your bot **token**, now you can re-execute the previous command, folders are going to generate. When you want to stop the bot, just print `stop` in the console.

For create a **plugin**, add the **N-Bot API** on your project libraries, your main class will need to extends **NBotPlugin** who contains `onLoad()`, `onEnable()` and `onDisable()` methods with `@Override` annotation.
For create a **plugin**, add the **N-Bot API** on your project libraries, your main class will need to extends **NBotPlugin** who contains `onLoad()`, `onRegisterCommands()`, `onEnable()` and `onDisable()` methods with `@Override` annotation.

```java
public class MyPlugin extends NBotPlugin
Expand All @@ -14,6 +14,12 @@ public class MyPlugin extends NBotPlugin
super("Author");
}

@Override
public void onCommandRegisters()
{
NBot.getLogger().log("Command registered for MyPlugin.");
}

@Override
public void onLoad()
{
Expand Down Expand Up @@ -51,18 +57,17 @@ public class MyCommand
}
```

and register your command class in the `onEnable()` method like this.
and register your command class in the `onCommandRegisters()` method like this.

```java
import fr.neutronstars.nbot.command.CommandManager;

public class MyPlugin extends NBotPlugin
{
@Override
public void onEnable()
public void onCommandRegisters()
{
NBot.getLogger().log("MyPlugin is loaded.");
CommandManager.registerCommand(new MyCommand(), this);
super.registerCommand(MyCommand.class);
}
}
```
Expand Down

0 comments on commit 2da4d9e

Please sign in to comment.