From 7fffd976330a8b66e021cd2137f4e14eddbb7669 Mon Sep 17 00:00:00 2001 From: Hammer86gn Date: Mon, 9 Aug 2021 13:26:34 -0400 Subject: [PATCH 1/4] New Command & build changes + ContributeCommand - shows how to contribute to HelpBot - build.gradle - removed jcenter() as builds will no longer accept jcenter after Feb 1st of next year (better to be future-proof) = build.gradle - updated shadow jar version to 7.0.0 as well as other dependencies + build.gradle - made task build depend on shadowJar --- build.gradle | 13 ++++-- .../impl/other/info/ContributeCommand.java | 43 +++++++++++++++++++ 2 files changed, 52 insertions(+), 4 deletions(-) create mode 100644 src/main/java/com/diamondfire/helpbot/bot/command/impl/other/info/ContributeCommand.java diff --git a/build.gradle b/build.gradle index 36fc4187..927bb7dc 100644 --- a/build.gradle +++ b/build.gradle @@ -1,14 +1,13 @@ plugins { id 'java' id 'application' - id 'com.github.johnrengelman.shadow' version '6.0.0' + id 'com.github.johnrengelman.shadow' version '7.0.0' } mainClassName = 'com.diamondfire.helpbot.HelpBot' group 'com.diamondfire.helpbot' repositories { mavenCentral() - jcenter() maven { url 'https://jitpack.io' } maven { name 'm2-dv8tion' @@ -20,8 +19,8 @@ dependencies { implementation ("net.dv8tion:JDA:4.3.0_305") { exclude module: 'opus-java' } - implementation 'club.minnced:discord-webhooks:0.5.7' - implementation 'ch.qos.logback:logback-classic:1.2.3' + implementation 'club.minnced:discord-webhooks:0.5.8' + implementation 'ch.qos.logback:logback-classic:1.2.5' implementation group: 'com.google.code.gson', name: 'gson', version: '2.8.6' implementation 'com.github.Steveice10:MCProtocolLib:c5e4b66' implementation group: 'mysql', name: 'mysql-connector-java', version: '5.1.13' @@ -32,3 +31,9 @@ compileJava.options.encoding = 'UTF-8' tasks.withType(JavaCompile) { options.encoding = 'UTF-8' } + +build { + dependsOn { + shadowJar + } +} diff --git a/src/main/java/com/diamondfire/helpbot/bot/command/impl/other/info/ContributeCommand.java b/src/main/java/com/diamondfire/helpbot/bot/command/impl/other/info/ContributeCommand.java new file mode 100644 index 00000000..7be487c2 --- /dev/null +++ b/src/main/java/com/diamondfire/helpbot/bot/command/impl/other/info/ContributeCommand.java @@ -0,0 +1,43 @@ +package com.diamondfire.helpbot.bot.command.impl.other.info; + +import com.diamondfire.helpbot.bot.command.argument.ArgumentSet; +import com.diamondfire.helpbot.bot.command.help.*; +import com.diamondfire.helpbot.bot.command.impl.Command; +import com.diamondfire.helpbot.bot.command.permissions.Permission; +import com.diamondfire.helpbot.bot.command.reply.PresetBuilder; +import com.diamondfire.helpbot.bot.command.reply.feature.informative.*; +import com.diamondfire.helpbot.bot.events.CommandEvent; + +public class ContributeCommand extends Command { + + @Override + public String getName() { + return "contribute"; + } + + @Override + public HelpContext getHelpContext() { + return new HelpContext().category(CommandCategory.OTHER).description("Gives directions on how to contribute to HelpBot"); + } + + @Override + protected ArgumentSet compileArguments() { + return new ArgumentSet(); + } + + @Override + public Permission getPermission() { + return Permission.USER; + } + + @Override + public void run(CommandEvent event) { + + PresetBuilder res = new PresetBuilder() + .withPreset(new InformativeReply(InformativeReplyType.INFO,"How to Contribute", + "You may contribute to HelpBot by forking it on github(https://github.com/MCDiamondFire/HelpBot)\n " + + "then creating a pull request")); + event.reply(res); + + } +} From c3a551d764030f52e2b99d9f3f797c4a0db10ada Mon Sep 17 00:00:00 2001 From: Hammer86gn Date: Mon, 9 Aug 2021 13:28:44 -0400 Subject: [PATCH 2/4] New Command & build changes + ContributeCommand - shows how to contribute to HelpBot - build.gradle - removed jcenter() as builds will no longer accept jcenter after Feb 1st of next year (better to be future-proof) = build.gradle - updated shadow jar version to 7.0.0 as well as other dependencies + build.gradle - made task build depend on shadowJar --- src/main/java/com/diamondfire/helpbot/bot/HelpBotInstance.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/com/diamondfire/helpbot/bot/HelpBotInstance.java b/src/main/java/com/diamondfire/helpbot/bot/HelpBotInstance.java index 6a44cae5..5db31bff 100644 --- a/src/main/java/com/diamondfire/helpbot/bot/HelpBotInstance.java +++ b/src/main/java/com/diamondfire/helpbot/bot/HelpBotInstance.java @@ -77,6 +77,7 @@ public static void initialize() throws LoginException { new PollCommand(), new IdeaCommand(), new StoreCommand(), + new ContributeCommand(), //new ChannelMuteCommand(), // statsbot new StatsCommand(), From e4d42a5f1ecaae12c8e2afe6643a63c82be19859 Mon Sep 17 00:00:00 2001 From: Hammer86gn Date: Mon, 9 Aug 2021 17:37:20 -0400 Subject: [PATCH 3/4] Deleted Command cause tag system --- .../impl/other/info/ContributeCommand.java | 43 ------------------- 1 file changed, 43 deletions(-) delete mode 100644 src/main/java/com/diamondfire/helpbot/bot/command/impl/other/info/ContributeCommand.java diff --git a/src/main/java/com/diamondfire/helpbot/bot/command/impl/other/info/ContributeCommand.java b/src/main/java/com/diamondfire/helpbot/bot/command/impl/other/info/ContributeCommand.java deleted file mode 100644 index 7be487c2..00000000 --- a/src/main/java/com/diamondfire/helpbot/bot/command/impl/other/info/ContributeCommand.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.diamondfire.helpbot.bot.command.impl.other.info; - -import com.diamondfire.helpbot.bot.command.argument.ArgumentSet; -import com.diamondfire.helpbot.bot.command.help.*; -import com.diamondfire.helpbot.bot.command.impl.Command; -import com.diamondfire.helpbot.bot.command.permissions.Permission; -import com.diamondfire.helpbot.bot.command.reply.PresetBuilder; -import com.diamondfire.helpbot.bot.command.reply.feature.informative.*; -import com.diamondfire.helpbot.bot.events.CommandEvent; - -public class ContributeCommand extends Command { - - @Override - public String getName() { - return "contribute"; - } - - @Override - public HelpContext getHelpContext() { - return new HelpContext().category(CommandCategory.OTHER).description("Gives directions on how to contribute to HelpBot"); - } - - @Override - protected ArgumentSet compileArguments() { - return new ArgumentSet(); - } - - @Override - public Permission getPermission() { - return Permission.USER; - } - - @Override - public void run(CommandEvent event) { - - PresetBuilder res = new PresetBuilder() - .withPreset(new InformativeReply(InformativeReplyType.INFO,"How to Contribute", - "You may contribute to HelpBot by forking it on github(https://github.com/MCDiamondFire/HelpBot)\n " + - "then creating a pull request")); - event.reply(res); - - } -} From fe0a2ca5d2a0c9e6c4ca2c10cbb0c7ddc0d923ec Mon Sep 17 00:00:00 2001 From: Hammer86gn Date: Mon, 9 Aug 2021 17:38:38 -0400 Subject: [PATCH 4/4] Deleted Command cause tag system --- src/main/java/com/diamondfire/helpbot/bot/HelpBotInstance.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/com/diamondfire/helpbot/bot/HelpBotInstance.java b/src/main/java/com/diamondfire/helpbot/bot/HelpBotInstance.java index 5db31bff..6a44cae5 100644 --- a/src/main/java/com/diamondfire/helpbot/bot/HelpBotInstance.java +++ b/src/main/java/com/diamondfire/helpbot/bot/HelpBotInstance.java @@ -77,7 +77,6 @@ public static void initialize() throws LoginException { new PollCommand(), new IdeaCommand(), new StoreCommand(), - new ContributeCommand(), //new ChannelMuteCommand(), // statsbot new StatsCommand(),