-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added API instructions
- Loading branch information
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
``` | ||
|