Skip to content

Commit

Permalink
Merge pull request #115 from Gerald-Development/dev
Browse files Browse the repository at this point in the history
Merge dev into main
  • Loading branch information
ElementalMP4 authored Jun 24, 2021
2 parents b86f374 + 303fe41 commit 2434304
Show file tree
Hide file tree
Showing 92 changed files with 1,829 additions and 193 deletions.
86 changes: 56 additions & 30 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
<artifactId>BaristaGerald</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>BaristaGerald</name>
<properties>
<finalName>${project.artifactId}-${project.version}</finalName>
</properties>
<build>
<sourceDirectory>src</sourceDirectory>
<finalName>${finalName}</finalName>
<properties>
<finalName>${project.artifactId}-${project.version}</finalName>
</properties>
<build>
<sourceDirectory>src</sourceDirectory>
<finalName>${finalName}</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand All @@ -30,7 +30,7 @@
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version><!--$NO-MVN-MAN-VER$-->
<version>3.8.1</version><!--$NO-MVN-MAN-VER$ -->
<configuration>
<source>1.8</source>
<target>1.8</target>
Expand All @@ -39,7 +39,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version><!--$NO-MVN-MAN-VER$-->
<version>3.2.4</version><!--$NO-MVN-MAN-VER$ -->
<executions>
<execution>
<phase>package</phase>
Expand All @@ -48,18 +48,18 @@
</goals>
<configuration>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/spring.handlers</resource>
</transformer>
<transformer
implementation="org.springframework.boot.maven.PropertiesMergingResourceTransformer">
<resource>META-INF/spring.factories</resource>
</transformer>
<transformer
implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/spring.schemas</resource>
</transformer>
<transformer
implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/spring.handlers</resource>
</transformer>
<transformer
implementation="org.springframework.boot.maven.PropertiesMergingResourceTransformer">
<resource>META-INF/spring.factories</resource>
</transformer>
<transformer
implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/spring.schemas</resource>
</transformer>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>main.java.de.voidtech.gerald.Gerald</mainClass>
Expand All @@ -76,19 +76,19 @@
<id>jcenter</id>
<name>jcenter-bintray</name>
<url>https://jcenter.bintray.com</url>
</repository>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>net.dv8tion</groupId>
<artifactId>JDA</artifactId>
<version>4.2.0_247</version>
<exclusions>
<exclusion>
<groupId>club.minnced</groupId>
<artifactId>opus-java</artifactId>
</exclusion>
</exclusions>
<exclusion>
<groupId>club.minnced</groupId>
<artifactId>opus-java</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
Expand Down Expand Up @@ -165,10 +165,36 @@
<version>5.2.7.RELEASE</version><!--$NO-MVN-MAN-VER$ -->
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-text</artifactId>
<version>1.9</version>
<groupId>org.apache.commons</groupId>
<artifactId>commons-text</artifactId>
<version>1.9</version>
</dependency>
<dependency>
<groupId>com.microsoft.playwright</groupId>
<artifactId>playwright</artifactId>
<version>1.12.1</version>
</dependency>
<dependency>
<groupId>com.github.twitch4j</groupId>
<artifactId>twitch4j</artifactId>
<version>1.5.0</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.12.3</version><!--$NO-MVN-MAN-VER$-->
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.12.3</version><!--$NO-MVN-MAN-VER$-->
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.12.3</version><!--$NO-MVN-MAN-VER$-->
</dependency>



</dependencies>
</project>
4 changes: 2 additions & 2 deletions src/main/java/de/voidtech/gerald/Gerald.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
BaristaGerald A General Purpose Discord Bot
Copyright (C) 2020-2021 Barista Gerald Dev Team (http://github.com/Montori/Barista-Gerald)
Copyright (C) 2020-2021 Barista Gerald Dev Team (https://github.com/Gerald-Development/Barista-Gerald)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -68,7 +68,7 @@ public JDA getJDA(MessageListener msgListener, GuildGoneListener guildGoneListen
.enableIntents(getNonPrivilegedIntents())
.setMemberCachePolicy(MemberCachePolicy.ALL)
.setBulkDeleteSplittingEnabled(false)
.setStatus(OnlineStatus.IDLE)
.setStatus(OnlineStatus.ONLINE)
.setCompression(Compression.NONE)
.addEventListeners(eventWaiter, msgListener, readyListener, guildGoneListener, channelDeleteListener, memberListener, starboardListener)
.setActivity(EntityBuilder.createActivity(globalConf.getStatus(),
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/de/voidtech/gerald/GlobalConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ public class GlobalConstants {
public static final String STREAM_URL = "https://twitch.tv/elementalmp4";
public static final String LINKTREE_URL = "https://linktr.ee/GeraldBot";
public static final String INVITE_URL = "https://discord.com/api/oauth2/authorize?client_id=555816892141404163&permissions=805694544&scope=bot";
public static final String VERSION = "1.1.4 - Latte Macchiato";
public static final String VERSION = "1.2.0 - Mucho Mocha";
}
22 changes: 15 additions & 7 deletions src/main/java/de/voidtech/gerald/commands/AbstractCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,18 @@ public abstract class AbstractCommand{
ThreadManager threadManager;

private void runCommandInThread(Message message, List<String> args) {
Runnable commandThreadRunnable = new Runnable() {
public void run() {
executeInternal(message, args);
}
};
threadManager.getThreadByName("T-Command").execute(commandThreadRunnable);
if (message.getChannel().getType() == ChannelType.PRIVATE && !this.isDMCapable()) {
message.getChannel().sendMessage("**You can only use this command in guilds!**").queue();
} else if (this.requiresArguments() && args.size() < 1) {
message.getChannel().sendMessage("**This command needs arguments to work! See the help command for more details!**\n" + this.getUsage()).queue();
} else {
Runnable commandThreadRunnable = new Runnable() {
public void run() {
executeInternal(message, args);
}
};
threadManager.getThreadByName("T-Command").execute(commandThreadRunnable);
}
}

public void run(Message message, List<String> args) {
Expand All @@ -43,7 +49,7 @@ public void run(Message message, List<String> args) {
if((channelWhitelisted && !commandOnBlacklist) || message.getMember().hasPermission(Permission.ADMINISTRATOR))
{
runCommandInThread(message, args);
}
}
}
}

Expand All @@ -62,5 +68,7 @@ public void run(Message message, List<String> args) {
public abstract boolean requiresArguments();

public abstract String[] getCommandAliases();

public abstract boolean canBeDisabled();

}
5 changes: 5 additions & 0 deletions src/main/java/de/voidtech/gerald/commands/TestCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,9 @@ public String[] getCommandAliases() {
String[] aliases = {"test"};
return aliases;
}

@Override
public boolean canBeDisabled() {
return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,9 @@ public String[] getCommandAliases() {
return aliases;
}

@Override
public boolean canBeDisabled() {
return true;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,10 @@ public String[] getCommandAliases() {
String[] aliases = {"hold"};
return aliases;
}

@Override
public boolean canBeDisabled() {
return true;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,10 @@ public String[] getCommandAliases() {
String[] aliases = {"peck", "canoodle"};
return aliases;
}

@Override
public boolean canBeDisabled() {
return true;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,9 @@ public String[] getCommandAliases() {
String[] aliases = {"bite"};
return aliases;
}

@Override
public boolean canBeDisabled() {
return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,9 @@ public String[] getCommandAliases() {
String[] aliases = {"headpat"};
return aliases;
}

@Override
public boolean canBeDisabled() {
return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,9 @@ public String[] getCommandAliases() {
String[] aliases = {"boop"};
return aliases;
}

@Override
public boolean canBeDisabled() {
return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,10 @@ public String[] getCommandAliases() {
String[] aliases = {"smack", "hit", "punch", "kill"};
return aliases;
}

@Override
public boolean canBeDisabled() {
return true;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,9 @@ public String[] getCommandAliases() {
String[] aliases = {"fondle"};
return aliases;
}


@Override
public boolean canBeDisabled() {
return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,10 @@ public String[] getCommandAliases() {
String[] commandAliases = {"a"};
return commandAliases;
}

@Override
public boolean canBeDisabled() {
return true;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,9 @@ public String[] getCommandAliases() {
String[] aliases = {"clapback"};
return aliases;
}

@Override
public boolean canBeDisabled() {
return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,9 @@ public String[] getCommandAliases() {
String[] aliases = {"big"};
return aliases;
}

@Override
public boolean canBeDisabled() {
return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,8 @@ public String[] getCommandAliases() {
return aliases;
}

@Override
public boolean canBeDisabled() {
return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -99,5 +99,10 @@ public String[] getCommandAliases() {
String[] aliases = {"zalgoify", "fucktext"};
return aliases;
}

@Override
public boolean canBeDisabled() {
return true;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,9 @@ public String[] getCommandAliases() {
String[] aliases = {"nasa", "nasaapod", "astronomy"};
return aliases;
}

@Override
public boolean canBeDisabled() {
return true;
}
}
5 changes: 5 additions & 0 deletions src/main/java/de/voidtech/gerald/commands/fun/AskCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,9 @@ public String[] getCommandAliases() {
String[] aliases = {"whatif"};
return aliases;
}

@Override
public boolean canBeDisabled() {
return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -127,5 +127,10 @@ public String[] getCommandAliases() {
String[] aliases = {"bguess", "berryguess"};
return aliases;
}

@Override
public boolean canBeDisabled() {
return true;
}

}
5 changes: 5 additions & 0 deletions src/main/java/de/voidtech/gerald/commands/fun/CatCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,5 +94,10 @@ public String[] getCommandAliases() {
String[] aliases = {"gato", "catto"};
return aliases;
}

@Override
public boolean canBeDisabled() {
return true;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -161,5 +161,10 @@ public String[] getCommandAliases() {
String[] aliases = {"ai", "geraldai", "geraldchat", "gavin"};
return aliases;
}

@Override
public boolean canBeDisabled() {
return true;
}

}
Loading

0 comments on commit 2434304

Please sign in to comment.