-
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.
- Loading branch information
Showing
7 changed files
with
89 additions
and
17 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
20 changes: 18 additions & 2 deletions
20
src/main/java/me/ashfaq/commandReporterPlugin/CommandReporterPlugin.java
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,18 +1,34 @@ | ||
package me.ashfaq.commandReporterPlugin; | ||
|
||
import me.ashfaq.commandReporterPlugin.Webhooks.Discord_WH; | ||
import org.bukkit.event.EventHandler; | ||
import org.bukkit.event.Listener; | ||
import org.bukkit.event.player.PlayerCommandPreprocessEvent; | ||
import org.bukkit.plugin.java.JavaPlugin; | ||
|
||
public final class CommandReporterPlugin extends JavaPlugin { | ||
public final class CommandReporterPlugin extends JavaPlugin implements Listener { | ||
|
||
static String webhookUrl = "https://discord.com/api/webhooks/1296440357722001419/5R7Mji5GtfzeerHAjeQoS6o2zXs0qrkqTp-ekBDi6j-72075BCO2penB3UolHPXDsWEJ"; | ||
|
||
@Override | ||
public void onEnable() { | ||
// Plugin startup logic | ||
System.out.println("CommandReporter plugin started"); | ||
System.out.println("CommandReporter plugin started boiiii");; | ||
|
||
getServer().getPluginManager().registerEvents(this, this); | ||
} | ||
|
||
@Override | ||
public void onDisable() { | ||
// Plugin shutdown logic | ||
System.out.println("CommandReporter plugin stopped"); | ||
} | ||
|
||
@EventHandler | ||
public void onCommandSend(PlayerCommandPreprocessEvent event){ | ||
String Player = String.valueOf(event.getPlayer().getName()); | ||
String command = event.getMessage(); | ||
Boolean Suspicion = false; | ||
new Discord_WH().sendRequest(webhookUrl, Player, command, Suspicion); | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
src/main/java/me/ashfaq/commandReporterPlugin/CommandReporterSettings.java
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package me.ashfaq.commandReporterPlugin; | ||
|
||
public class CommandReporterSettings { | ||
} |
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
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,5 +1,5 @@ | ||
name: CommandReporterPlugin | ||
version: '1.0-SNAPSHOT' | ||
main: me.ashfaq.commandReporterPlugin.CommandReporterPlugin | ||
api-version: '1.21.1' | ||
api-version: '1.21' | ||
description: "A spigot plugin that reports commands executed by players." |
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# This file contains the settings for the Command Reporter Plugin. For setting suspicious commands, head over to the "suspicious commands.yml" file. | ||
|
||
discord: | ||
webhook-url: "" | ||
webhook-username: "Command Reporter" | ||
webhook-avatar-url: "" | ||
embed-color: "65280" | ||
embed-icon-url: "https://i.imgur.com/ZTuP6fGb.jpg" | ||
|
||
# Leave both of these empty if you don't want a footer. | ||
embed-footer-text: "Command Reporter Plugin" | ||
embed-footer-icon-url: "" | ||
|
||
# Specify the discord role that will be mentioned if a suspicious command is executed. | ||
# DO NOT INCLUDE THE @ SYMBOL | ||
admin-role: "everyone" |
Empty file.