Skip to content
This repository was archived by the owner on May 27, 2020. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 41 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,41 @@
# DiscordWebhook
# DiscordWebhook

If you are looking for the binary version of the plugin, just head over
to https://www.spigotmc.org/resources/discord-webhook.51537/


## How to Install

Assuming you are installing from a build:

You will first need to have a [Spigot](https://www.spigotmc.org/)
Minecraft server running. Then copy the following JAR to the Spigot
build folder:

DiscordWebhook-Spigot-1.0.1-jar-with-dependencies.jar

## How to Configure

On first launch the server will complain that the "The Webhook URL is empty!".
At this point modify the new `DiscordWebhook/config.yml` that was created
in the plugin folder.

Set the URL to the one given to you by Discord and then restart the server.
At this point you should see your first message in the Discord channel you
created the webhook for.

## How to Build

If you are looking to make changes, then you'll need to get both the JDK
(Java Development Kit) and Maven installed on your computer.

These may be available via your system's package manager (apt, chocolatey, brew, MacPorts) or directly from the source sites:

- https://www.oracle.com/java/technologies/javase-downloads.html
- https://maven.apache.org/

Once you have them set up you'll need to run Maven:

```
mvn package
```
39 changes: 21 additions & 18 deletions src/main/java/me/artuto/discordwebhook/CommandHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,29 @@ public class CommandHandler implements CommandExecutor
@Override
public boolean onCommand(CommandSender executor, Command cmd, String label, String[] args)
{
switch(cmd.getName().toLowerCase())
if (cmd.getName().toLowerCase().equals("webhook"))
{
case "webhook":
if(args.length==0)
executor.sendMessage(ChatColor.DARK_BLUE+"-====== Webhook Help ======-"+ChatColor.RESET +
"\n/webhook about - Shows information about the plugin" +
"\n/webhook help - Shows this message");
else if(args[0].equals("about"))
executor.sendMessage("Plugin made by "+ChatColor.GREEN+"Artuto" +
ChatColor.RESET+"\nPlugin Version: "+ChatColor.GREEN+Const.VERSION+ChatColor.RESET +
"\nDonations are accepted! "+ChatColor.AQUA+"https://paypal.me/artuto");
else if(args[0].equals("help"))
executor.sendMessage(ChatColor.DARK_BLUE+"-====== Webhook Help ======-"+ChatColor.RESET +
"\n/webhook about - Shows information about the plugin" +
"\n/webhook help - Shows this message");
break;
default:
return false;
if(args.length==0)
{
executor.sendMessage(ChatColor.DARK_BLUE+"-====== Webhook Help ======-"+ChatColor.RESET +
"\n/webhook about - Shows information about the plugin" +
"\n/webhook help - Shows this message");
}
else if(args[0].equals("about"))
{
executor.sendMessage("Plugin made by "+ChatColor.GREEN+"Artuto" +
ChatColor.RESET+"\nPlugin Version: "+ChatColor.GREEN+Const.VERSION+ChatColor.RESET +
"\nDonations are accepted! "+ChatColor.AQUA+"https://paypal.me/artuto");
}
else if(args[0].equals("help"))
{
executor.sendMessage(ChatColor.DARK_BLUE+"-====== Webhook Help ======-"+ChatColor.RESET +
"\n/webhook about - Shows information about the plugin" +
"\n/webhook help - Shows this message");
}
return true;
}

return true;
return false;
}
}
2 changes: 1 addition & 1 deletion src/main/java/me/artuto/discordwebhook/EventListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,6 @@ public void onPluginDisable(PluginDisableEvent event)
{
if(!(event.getPlugin().getName().equals("DiscordWebhook")))
return;
Sender.shutdown(event.getSender().getServer(), config.getUrl());
Sender.shutdown(event.getPlugin().getServer(), config.getUrl());
}
}