Skip to content

Commit

Permalink
Updated README.md
Browse files Browse the repository at this point in the history
Added API instructions
  • Loading branch information
OllieJW authored Jun 18, 2021
1 parent 9956433 commit 725682a
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,39 @@
# CmdWebhooks
CmdWebhooks Logs all Joins, Leaves, Commands, Chat and more to your Discord server using webhooks!

# API
**Make the event: (If you arent using events, skip this)**
In this example we will make a Votifier Logger!
```
import com.vexsoftware.votifier.model.VotifierEvent;
@EventHandler
public void onVote(VotifierEvent event) {
}
```

**Use CmdWebhooks:**
```
// Get our webhook link ready
SendWebhook webhook = new SendWebhook("WEBHOOK_LINK");
// Get our Content Ready
webhook.setContent("Message to send to Discord");
// Sending our Message (Embed it in a try/catch)
try {
webhook.execute();
} catch(Exception e){
System.out.println("ERROR SENDING VOTE WEBHOOK!!!");
}
```

**Register our event: (Main Class)**
```
@Override
public void onEnable() {
this.getServer().getPluginManager().registerEvents(new VoteEvent(), this);
}
```

0 comments on commit 725682a

Please sign in to comment.