begin update to newer JDA

This commit is contained in:
Ghoti 2025-04-19 17:36:00 -05:00
parent 22c02c6477
commit 25acb23488
75 changed files with 416 additions and 284 deletions

View File

@ -9,6 +9,7 @@
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"> <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes> <attributes>
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
<attribute name="optional" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
@ -28,5 +29,12 @@
<attribute name="test" value="true"/> <attribute name="test" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/> <classpathentry kind="output" path="target/classes"/>
</classpath> </classpath>

View File

@ -7,7 +7,9 @@ org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
org.eclipse.jdt.core.compiler.release=disabled org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.8 org.eclipse.jdt.core.compiler.source=1.8

140
config.properties Normal file
View File

@ -0,0 +1,140 @@
#This doesn't do anything, but is set by the program to help users identify the guild associated with the file
Guild-Identifier = Main Config
#Change this to redefine the main command signifier character/String
Command-Signifier = -
#Set to false to disable chat logging
ChatLog = true
#Automatically places spammers in spam mode
AllowSpamPunish = true
Channels-To-Not-Chatlog = ignore_me,ignore_me2,ignore_me3
#Bot token provided by Discord
Bot-Token =
#Normal channels will have messages with these words deleted by the bot
NaughtyList = piff,word123,another1
#Set to true if you want to limit the channels bot commands can be done in
#Admins will be able to bypass this
Restrict-Cmd-Channels = false
#Channels to restrict bot commands to
CmdChannels = bot,bot2,bot3
#Allow users to toggle these roles
ToggleRoles = role1,role2,role3
#Restrict these toggle roles to boosters. Will be removed on boost cancel
Boost-Exclusive-Roles = role2,role3
#Treat these roles like booster.
Treat-Like-Booster = Nitro Booster,silver,gold
#Bot can automatically assign role upon user join
UseCustomDefaultRole = true
#This role will give Biscuit mod commands to users with the role
ModRole = biscuit-key
#This role will give complete admin bot access to users with the role
AdminRole = biscuit-admin
#In these channels, the bot will toggle roles for the ToggleRoles for anyone
#who reacts to a message with [Toggle <Role name>]
Toggle-Role-React-Channels = toggleroles1,toggleroles2,toggleroles3
#Does nothing if UseCustomDefaultRole is off
DefaultRoleName = Standard
#Custom Emote to react with when action is complete
Done-Emote = ActionComplete
#Set true to enable captcha
#Use with UseCustomDefaultRole enabled
#Will require user to have that role for captcha check
#Role will be replaced with reward role on clear
Captcha = false
#All channels listed here will allow for users in these channels
#to initiate captcha with the bot.
Captcha-Channels = captcha,verification
#Reward this role when captcha cleared
Captcha-Reward-Role = cleared
#Kick if Captcha is not completed in a timely manner
No-Captcha-Kick = false
#Kick user after this number of minutes has passed without captcha clear
#Due to the way the countdown works, the kick may not happen until at most one minute after
No-Captcha-Kick-Time = 10
#Messages with these unicode emotes will be removed
Block-Unicode-Emotes = baby,snake,squid
#Messages with these custom emotes will be removed
Block-Custom-Emotes = badfish,fix,bigleaf
#Disable these commands for ALL users
DisabledCommands = cmd1,cmd2,cmd3
#Disabled these commands for normal users
DisabledUserCommands = cmd4,cmd5,cmd6
#Checks which invite users join with. Requires bot to have Manage Server permission.
Check-Join-Invite = false
#Enables the captcha text-channel logging.
#Logs join, complete captcha, invite joined with, and time-out kick
LogCaptcha = false
#Put the name of the text channel you want to log captcha information to.
Captcha-Log-Channel = verify-log
#DM the user before kicking for captcha.
DM-Before-Kick = true
#Send an invite to the server when dm-ing kicked users
#Does nothing when blank
#Use full link
Kick-DM-Invite =
#Enable Music Bot functionality.
#This command is for the bot admin only. If disabled, no guild
#Will be allowed to enable and use the Music bot commands.
Enable-Music-Bot = true
#Individual guild owners can enable/disable this to allow/disallow
#Music bot features in their server. Defaults to the setting
#Set in the main config.properties. This will do nothing if
#Enable-Music-Bot is already set to false.
Allow-Music-Bot = true
#This logs music player events to the terminal.
#The music player logs may be annoyance. Disable them here.
#Errors will still be logged.
Log-Music-Player = true
#To restrict music to certain channels, add them here.
#i.e:
#Music-Channels = Room 1, Room 2
Music-Channels =
#Users with this role have complete control over the music player.
#Automatically granted to Mods and Admins.
Music-Controller-Role = music-key
#List your custom commands here. This line will always generate blank.
#Example - Custom-Command-Names = hello,botcheck,apple
Custom-Command-Names =
#Placeholder(s):
#<user> - Mentions the sender
#Setting up custom commands works like this:
#
#cc-hello-message = Hello, <user>!
#cc-hello-description = Greets the sender.

View File

@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>com.fpghoti</groupId> <groupId>com.fpghoti</groupId>
<artifactId>Biscuit</artifactId> <artifactId>Biscuit</artifactId>
<version>1.11</version> <version>1.13</version>
<build> <build>
<sourceDirectory>src/main/java</sourceDirectory> <sourceDirectory>src/main/java</sourceDirectory>
<resources> <resources>
@ -13,20 +13,10 @@
</resource> </resource>
</resources> </resources>
<plugins> <plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<encoding>UTF-8</encoding>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin> <plugin>
<artifactId>maven-jar-plugin</artifactId> <artifactId>maven-jar-plugin</artifactId>
<version>2.4</version> <version>2.4</version>
<configuration> <configuration>
<encoding>UTF-8</encoding>
<archive> <archive>
<manifest> <manifest>
<mainClass>com.fpghoti.biscuit.Main</mainClass> <mainClass>com.fpghoti.biscuit.Main</mainClass>
@ -44,7 +34,6 @@
<goal>shade</goal> <goal>shade</goal>
</goals> </goals>
<configuration> <configuration>
<encoding>UTF-8</encoding>
<minimizeJar>true</minimizeJar> <minimizeJar>true</minimizeJar>
<filters> <filters>
<filter> <filter>
@ -96,13 +85,15 @@
</repositories> </repositories>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.bukkit</groupId> <groupId>org.spigotmc</groupId>
<artifactId>bukkit</artifactId> <artifactId>spigot-api</artifactId>
<version>1.16.4-R0.1-SNAPSHOT</version> <version>1.21.4-R0.1-SNAPSHOT</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
</dependencies> </dependencies>
<properties> <properties>
<maven.compiler.target>8</maven.compiler.target>
<maven.compiler.source>8</maven.compiler.source>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties> </properties>

111
pom.xml
View File

@ -5,7 +5,15 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>com.fpghoti</groupId> <groupId>com.fpghoti</groupId>
<artifactId>Biscuit</artifactId> <artifactId>Biscuit</artifactId>
<version>1.12</version> <version>2.0 Beta</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>
<build> <build>
<sourceDirectory>src/main/java</sourceDirectory> <sourceDirectory>src/main/java</sourceDirectory>
<resources> <resources>
@ -15,32 +23,10 @@
</resource> </resource>
</resources> </resources>
<plugins> <plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<encoding>UTF-8</encoding>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<configuration>
<encoding>UTF-8</encoding>
<archive>
<manifest>
<mainClass>com.fpghoti.biscuit.Main</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId> <artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version> <version>3.6.0</version>
<executions> <executions>
<execution> <execution>
<phase>package</phase> <phase>package</phase>
@ -48,38 +34,23 @@
<goal>shade</goal> <goal>shade</goal>
</goals> </goals>
<configuration> <configuration>
<encoding>UTF-8</encoding> <transformers>
<minimizeJar>true</minimizeJar> <transformer
<filters> implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<filter> <mainClass>com.fpghoti.biscuit.Main</mainClass>
<artifact>org.tuxdude.logback.extensions:logback-colorizer</artifact> </transformer>
<includes> </transformers>
<include>**</include>
</includes> <createDependencyReducedPom>false</createDependencyReducedPom>
</filter>
<filter>
<artifact>commons-logging:commons-logging</artifact>
<includes>
<include>**</include>
</includes>
</filter>
</filters>
</configuration> </configuration>
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
<repositories> <repositories>
<repository>
<id>dv8tion</id>
<name>m2-dv8tion</name>
<url>https://m2.dv8tion.net/releases</url>
</repository>
<repository> <repository>
<id>spigot-repo</id> <id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url> <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
@ -92,26 +63,17 @@
<id>oss.sonatype.org</id> <id>oss.sonatype.org</id>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url> <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</repository> </repository>
<repository>
<id>jcenter</id>
<name>jcenter-bintray</name>
<url>https://jcenter.bintray.com</url>
</repository>
<repository> <repository>
<id>jitpack.io</id> <id>jitpack.io</id>
<url>https://jitpack.io</url> <url>https://jitpack.io</url>
</repository> </repository>
</repositories> </repositories>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.fusesource.jansi</groupId> <groupId>org.fusesource.jansi</groupId>
<artifactId>jansi</artifactId> <artifactId>jansi</artifactId>
<version>1.18</version> <version>2.4.1</version>
</dependency>
<dependency>
<groupId>org.tuxdude.logback.extensions</groupId>
<artifactId>logback-colorizer</artifactId>
<version>1.0.1</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.github.GhotiMayo</groupId> <groupId>com.github.GhotiMayo</groupId>
@ -121,43 +83,38 @@
<dependency> <dependency>
<groupId>org.apache.commons</groupId> <groupId>org.apache.commons</groupId>
<artifactId>commons-configuration2</artifactId> <artifactId>commons-configuration2</artifactId>
<version>2.7</version> <version>2.11.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.bukkit</groupId> <groupId>org.spigotmc</groupId>
<artifactId>bukkit</artifactId> <artifactId>spigot-api</artifactId>
<version>1.16.4-R0.1-SNAPSHOT</version> <version>1.21.4-R0.1-SNAPSHOT</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.squareup.okio</groupId> <groupId>com.squareup.okio</groupId>
<artifactId>okio</artifactId> <artifactId>okio</artifactId>
<version>2.4.0</version> <version>3.10.2</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>1.2.3</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>ch.qos.logback</groupId> <groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId> <artifactId>logback-classic</artifactId>
<version>1.2.3</version> <version>1.5.17</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.jcabi</groupId> <groupId>com.jcabi</groupId>
<artifactId>jcabi-aspects</artifactId> <artifactId>jcabi-aspects</artifactId>
<version>0.22.6</version> <version>0.26.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>joda-time</groupId> <groupId>joda-time</groupId>
<artifactId>joda-time</artifactId> <artifactId>joda-time</artifactId>
<version>2.3</version> <version>2.13.1</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.dv8tion</groupId> <groupId>net.dv8tion</groupId>
<artifactId>JDA</artifactId> <artifactId>JDA</artifactId>
<version>5.0.0-alpha.11</version> <version>5.3.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.github.cage</groupId> <groupId>com.github.cage</groupId>
@ -175,14 +132,14 @@
<version>1.4.7</version> <version>1.4.7</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.sedmelluq</groupId> <groupId>dev.arbjerg</groupId>
<artifactId>lavaplayer</artifactId> <artifactId>lavaplayer</artifactId>
<version>1.3.77</version> <version>2.2.3</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.pf4j</groupId> <groupId>org.pf4j</groupId>
<artifactId>pf4j</artifactId> <artifactId>pf4j</artifactId>
<version>3.4.1</version> <version>3.13.0</version>
</dependency> </dependency>
</dependencies> </dependencies>
</project> </project>

View File

@ -65,7 +65,7 @@ import com.fpghoti.biscuit.listener.NicknameListener;
import com.fpghoti.biscuit.listener.ReactionListener; import com.fpghoti.biscuit.listener.ReactionListener;
import com.fpghoti.biscuit.listener.RoleListener; import com.fpghoti.biscuit.listener.RoleListener;
import com.fpghoti.biscuit.logging.BColor; import com.fpghoti.biscuit.logging.BColor;
import com.fpghoti.biscuit.logging.BiscuitLog; import com.fpghoti.biscuit.logging.BiscuitLogger;
import com.fpghoti.biscuit.plugin.PluginController; import com.fpghoti.biscuit.plugin.PluginController;
import com.github.cage.Cage; import com.github.cage.Cage;
import com.sedmelluq.discord.lavaplayer.player.AudioPlayerManager; import com.sedmelluq.discord.lavaplayer.player.AudioPlayerManager;
@ -90,7 +90,7 @@ public class Main {
public RollingFileAppender<String> we; public RollingFileAppender<String> we;
public SizeAndTimeBasedRollingPolicy<String> wes; public SizeAndTimeBasedRollingPolicy<String> wes;
private static final BiscuitLog log = new BiscuitLog(); private static final BiscuitLogger log = new BiscuitLogger();
private static ArrayList<Biscuit> biscuits; private static ArrayList<Biscuit> biscuits;
private static Biscuit mainBiscuit; private static Biscuit mainBiscuit;
@ -224,8 +224,7 @@ public class Main {
shardm = DefaultShardManagerBuilder.createDefault(token) shardm = DefaultShardManagerBuilder.createDefault(token)
.setChunkingFilter(ChunkingFilter.ALL) .setChunkingFilter(ChunkingFilter.ALL)
.setMemberCachePolicy(MemberCachePolicy.ALL) .setMemberCachePolicy(MemberCachePolicy.ALL)
.enableIntents(GatewayIntent.getIntents(GatewayIntent.DEFAULT)) .enableIntents(GatewayIntent.getIntents(GatewayIntent.ALL_INTENTS))
.enableIntents(GatewayIntent.GUILD_MEMBERS)
.build(); .build();
jda = shardm.getShardById(0); jda = shardm.getShardById(0);
try { try {
@ -297,7 +296,7 @@ public class Main {
return cage; return cage;
} }
public static BiscuitLog getLogger() { public static BiscuitLogger getLogger() {
return log; return log;
} }

View File

@ -18,7 +18,7 @@ import com.sedmelluq.discord.lavaplayer.track.AudioTrack;
import com.sedmelluq.discord.lavaplayer.track.AudioTrackEndReason; import com.sedmelluq.discord.lavaplayer.track.AudioTrackEndReason;
import net.dv8tion.jda.api.entities.MessageEmbed; import net.dv8tion.jda.api.entities.MessageEmbed;
import net.dv8tion.jda.api.entities.TextChannel; import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
public class AudioScheduler extends AudioEventAdapter { public class AudioScheduler extends AudioEventAdapter {

View File

@ -4,8 +4,8 @@ import com.fpghoti.biscuit.biscuit.Biscuit;
import com.fpghoti.biscuit.rest.MessageText; import com.fpghoti.biscuit.rest.MessageText;
import net.dv8tion.jda.api.entities.Guild; import net.dv8tion.jda.api.entities.Guild;
import net.dv8tion.jda.api.entities.TextChannel; import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
import net.dv8tion.jda.api.entities.VoiceChannel; import net.dv8tion.jda.api.entities.channel.concrete.VoiceChannel;
import net.dv8tion.jda.api.events.message.MessageReceivedEvent; import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
import net.dv8tion.jda.api.managers.AudioManager; import net.dv8tion.jda.api.managers.AudioManager;
@ -17,7 +17,7 @@ public class PlayCommandUtil {
} }
Guild guild = event.getGuild(); Guild guild = event.getGuild();
Biscuit biscuit = Biscuit.getBiscuit(guild); Biscuit biscuit = Biscuit.getBiscuit(guild);
TextChannel textChannel = event.getTextChannel(); TextChannel textChannel = event.getChannel().asTextChannel();
String vcname = ""; String vcname = "";
if(!event.getMember().getVoiceState().inAudioChannel()) { if(!event.getMember().getVoiceState().inAudioChannel()) {

View File

@ -8,7 +8,7 @@ import com.fpghoti.biscuit.rest.MessageText;
import com.sedmelluq.discord.lavaplayer.track.AudioTrack; import com.sedmelluq.discord.lavaplayer.track.AudioTrack;
import net.dv8tion.jda.api.entities.MessageEmbed; import net.dv8tion.jda.api.entities.MessageEmbed;
import net.dv8tion.jda.api.entities.TextChannel; import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
public class AudioQueue { public class AudioQueue {

View File

@ -10,7 +10,7 @@ import com.sedmelluq.discord.lavaplayer.track.AudioTrack;
import net.dv8tion.jda.api.EmbedBuilder; import net.dv8tion.jda.api.EmbedBuilder;
import net.dv8tion.jda.api.entities.Member; import net.dv8tion.jda.api.entities.Member;
import net.dv8tion.jda.api.entities.MessageEmbed; import net.dv8tion.jda.api.entities.MessageEmbed;
import net.dv8tion.jda.api.entities.TextChannel; import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
public class QueuedTrack { public class QueuedTrack {

View File

@ -8,7 +8,7 @@ import com.fpghoti.biscuit.audio.request.youtube.YTRequest;
import com.fpghoti.biscuit.biscuit.Biscuit; import com.fpghoti.biscuit.biscuit.Biscuit;
import net.dv8tion.jda.api.entities.Message; import net.dv8tion.jda.api.entities.Message;
import net.dv8tion.jda.api.entities.TextChannel; import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
public abstract class PlayRequest { public abstract class PlayRequest {
@ -42,7 +42,7 @@ public abstract class PlayRequest {
case YOUTUBE_PRIORITY: case YOUTUBE_PRIORITY:
return new YTPriorityRequest(message, searchPhrase, insertSlot); return new YTPriorityRequest(message, searchPhrase, insertSlot);
case YOUTUBE_IMMEDIATE: case YOUTUBE_IMMEDIATE:
return new YTImmediateRequest(message.getTextChannel(), message.getAuthor().getId(), searchPhrase); return new YTImmediateRequest(message.getChannel().asTextChannel(), message.getAuthor().getId(), searchPhrase);
case SOUNDCLOUD: case SOUNDCLOUD:
return new SCRequest(message, searchPhrase); return new SCRequest(message, searchPhrase);
case SOUNDCLOUD_PRIORITY: case SOUNDCLOUD_PRIORITY:
@ -58,7 +58,7 @@ public abstract class PlayRequest {
private String identifier; private String identifier;
public PlayRequest(Message message, String identifier) { public PlayRequest(Message message, String identifier) {
this(message.getTextChannel(), message.getAuthor().getId(), identifier); this(message.getChannel().asTextChannel(), message.getAuthor().getId(), identifier);
} }
public PlayRequest(TextChannel channel, String authorId, String identifier) { public PlayRequest(TextChannel channel, String authorId, String identifier) {

View File

@ -3,14 +3,14 @@ package com.fpghoti.biscuit.audio.request.soundcloud;
import com.fpghoti.biscuit.audio.request.RequestType; import com.fpghoti.biscuit.audio.request.RequestType;
import net.dv8tion.jda.api.entities.Message; import net.dv8tion.jda.api.entities.Message;
import net.dv8tion.jda.api.entities.TextChannel; import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
public class SCPriorityRequest extends SCRequest{ public class SCPriorityRequest extends SCRequest{
int insertSlot; int insertSlot;
public SCPriorityRequest(Message message, String identifier, int insertSlot) { public SCPriorityRequest(Message message, String identifier, int insertSlot) {
this(message.getTextChannel(), message.getAuthor().getId(), identifier, insertSlot); this(message.getChannel().asTextChannel(), message.getAuthor().getId(), identifier, insertSlot);
} }
public SCPriorityRequest(TextChannel channel, String authorId, String identifier, int insertSlot) { public SCPriorityRequest(TextChannel channel, String authorId, String identifier, int insertSlot) {

View File

@ -4,14 +4,14 @@ import com.fpghoti.biscuit.audio.request.PlayRequest;
import com.fpghoti.biscuit.audio.request.RequestType; import com.fpghoti.biscuit.audio.request.RequestType;
import net.dv8tion.jda.api.entities.Message; import net.dv8tion.jda.api.entities.Message;
import net.dv8tion.jda.api.entities.TextChannel; import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
public class SCRequest extends PlayRequest{ public class SCRequest extends PlayRequest{
private boolean searchMode; private boolean searchMode;
public SCRequest(Message message, String identifier) { public SCRequest(Message message, String identifier) {
this(message.getTextChannel(), message.getAuthor().getId(), identifier); this(message.getChannel().asTextChannel(), message.getAuthor().getId(), identifier);
} }
public SCRequest(TextChannel channel, String authorId, String identifier) { public SCRequest(TextChannel channel, String authorId, String identifier) {

View File

@ -3,7 +3,8 @@ package com.fpghoti.biscuit.audio.request.youtube;
import com.fpghoti.biscuit.audio.request.RequestType; import com.fpghoti.biscuit.audio.request.RequestType;
import net.dv8tion.jda.api.entities.Message; import net.dv8tion.jda.api.entities.Message;
import net.dv8tion.jda.api.entities.TextChannel; //import net.dv8tion.jda.api.entities.TextChannel;
import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
public class YTImmediateRequest extends YTRequest{ public class YTImmediateRequest extends YTRequest{

View File

@ -3,14 +3,14 @@ package com.fpghoti.biscuit.audio.request.youtube;
import com.fpghoti.biscuit.audio.request.RequestType; import com.fpghoti.biscuit.audio.request.RequestType;
import net.dv8tion.jda.api.entities.Message; import net.dv8tion.jda.api.entities.Message;
import net.dv8tion.jda.api.entities.TextChannel; import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
public class YTPriorityRequest extends YTRequest{ public class YTPriorityRequest extends YTRequest{
int insertSlot; int insertSlot;
public YTPriorityRequest(Message message, String identifier, int insertSlot) { public YTPriorityRequest(Message message, String identifier, int insertSlot) {
this(message.getTextChannel(), message.getAuthor().getId(), identifier, insertSlot); this(message.getChannel().asTextChannel(), message.getAuthor().getId(), identifier, insertSlot);
} }
public YTPriorityRequest(TextChannel channel, String authorId, String identifier, int insertSlot) { public YTPriorityRequest(TextChannel channel, String authorId, String identifier, int insertSlot) {

View File

@ -4,14 +4,15 @@ import com.fpghoti.biscuit.audio.request.PlayRequest;
import com.fpghoti.biscuit.audio.request.RequestType; import com.fpghoti.biscuit.audio.request.RequestType;
import net.dv8tion.jda.api.entities.Message; import net.dv8tion.jda.api.entities.Message;
import net.dv8tion.jda.api.entities.TextChannel; //import net.dv8tion.jda.api.entities.TextChannel;
import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
public class YTRequest extends PlayRequest{ public class YTRequest extends PlayRequest{
private boolean searchMode; private boolean searchMode;
public YTRequest(Message message, String identifier) { public YTRequest(Message message, String identifier) {
this(message.getTextChannel(), message.getAuthor().getId(), identifier); this(message.getChannel().asTextChannel(), message.getAuthor().getId(), identifier);
} }
public YTRequest(TextChannel channel, String authorId, String identifier) { public YTRequest(TextChannel channel, String authorId, String identifier) {

View File

@ -13,7 +13,7 @@ import com.fpghoti.biscuit.audio.AudioScheduler;
import com.fpghoti.biscuit.config.BiscuitConfig; import com.fpghoti.biscuit.config.BiscuitConfig;
import com.fpghoti.biscuit.config.BiscuitProperties; import com.fpghoti.biscuit.config.BiscuitProperties;
import com.fpghoti.biscuit.logging.BColor; import com.fpghoti.biscuit.logging.BColor;
import com.fpghoti.biscuit.logging.BiscuitLog; import com.fpghoti.biscuit.logging.BiscuitLogger;
import com.fpghoti.biscuit.rest.MessageText; import com.fpghoti.biscuit.rest.MessageText;
import com.fpghoti.biscuit.timer.BiscuitTimer; import com.fpghoti.biscuit.timer.BiscuitTimer;
import com.fpghoti.biscuit.timer.task.ChatCountTimer; import com.fpghoti.biscuit.timer.task.ChatCountTimer;
@ -29,9 +29,11 @@ import net.dv8tion.jda.api.entities.Guild;
import net.dv8tion.jda.api.entities.Invite; import net.dv8tion.jda.api.entities.Invite;
import net.dv8tion.jda.api.entities.Member; import net.dv8tion.jda.api.entities.Member;
import net.dv8tion.jda.api.entities.Role; import net.dv8tion.jda.api.entities.Role;
import net.dv8tion.jda.api.entities.TextChannel; //import net.dv8tion.jda.api.entities.TextChannel;
import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
import net.dv8tion.jda.api.entities.User; import net.dv8tion.jda.api.entities.User;
public class Biscuit { public class Biscuit {
public static Biscuit getBiscuit(Guild g) { public static Biscuit getBiscuit(Guild g) {
@ -77,7 +79,7 @@ public class Biscuit {
private boolean isMain; private boolean isMain;
private JDA jda; private JDA jda;
private BiscuitLog logger; private BiscuitLogger logger;
private Timer timer; private Timer timer;
private List<BiscuitTimer> timers; private List<BiscuitTimer> timers;
private File captchaDir; private File captchaDir;
@ -93,7 +95,7 @@ public class Biscuit {
private CopyOnWriteArrayList<PreUser> users = new CopyOnWriteArrayList<PreUser>(); private CopyOnWriteArrayList<PreUser> users = new CopyOnWriteArrayList<PreUser>();
private HashMap<Member, Role> rolequeue; private HashMap<Member, Role> rolequeue;
public Biscuit(JDA jda, Guild guild, BiscuitLog log) { public Biscuit(JDA jda, Guild guild, BiscuitLogger log) {
this.jda = jda; this.jda = jda;
this.guild = guild; this.guild = guild;
this.logger = log; this.logger = log;

View File

@ -17,10 +17,11 @@ import com.github.cage.Cage;
import net.dv8tion.jda.api.entities.Guild; import net.dv8tion.jda.api.entities.Guild;
import net.dv8tion.jda.api.entities.Member; import net.dv8tion.jda.api.entities.Member;
import net.dv8tion.jda.api.entities.MessageChannel;
import net.dv8tion.jda.api.entities.PrivateChannel;
import net.dv8tion.jda.api.entities.Role; import net.dv8tion.jda.api.entities.Role;
import net.dv8tion.jda.api.entities.TextChannel; import net.dv8tion.jda.api.entities.channel.concrete.PrivateChannel;
import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
import net.dv8tion.jda.api.entities.channel.middleman.MessageChannel;
import net.dv8tion.jda.api.utils.FileUpload;
import net.dv8tion.jda.api.entities.User; import net.dv8tion.jda.api.entities.User;
public class Captcha { public class Captcha {
@ -102,10 +103,11 @@ public class Captcha {
genToken(); genToken();
generateImage(); generateImage();
File captcha = getImageFile(); File captcha = getImageFile();
FileUpload capUpload = FileUpload.fromData(captcha);
respond("Respond with the exact text in this image."); respond("Respond with the exact text in this image.");
channel.sendFile(captcha).submit(); //channel.sendFile(captcha).submit();
channel.sendFiles(capUpload);
}else { }else {
boolean disable = false; boolean disable = false;
if(captchaUser.inTestMode()) { if(captchaUser.inTestMode()) {

View File

@ -8,9 +8,9 @@ import com.fpghoti.biscuit.util.PermUtil;
import net.dv8tion.jda.api.JDA; import net.dv8tion.jda.api.JDA;
import net.dv8tion.jda.api.entities.Guild; import net.dv8tion.jda.api.entities.Guild;
import net.dv8tion.jda.api.entities.Member; import net.dv8tion.jda.api.entities.Member;
import net.dv8tion.jda.api.entities.MessageChannel;
import net.dv8tion.jda.api.entities.TextChannel;
import net.dv8tion.jda.api.entities.User; import net.dv8tion.jda.api.entities.User;
import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
import net.dv8tion.jda.api.entities.channel.middleman.MessageChannel;
public class HandleCaptcha { public class HandleCaptcha {

View File

@ -120,7 +120,7 @@ public class CommandManager {
public static void commandReply(MessageReceivedEvent event, String msg) { public static void commandReply(MessageReceivedEvent event, String msg) {
if(event != null) { if(event != null) {
MessageText.send(event.getTextChannel(), msg); MessageText.send(event.getChannel().asTextChannel(), msg);
}else { }else {
Main.getLogger().info(msg); Main.getLogger().info(msg);
} }

View File

@ -6,7 +6,8 @@ import com.fpghoti.biscuit.commands.base.ConsoleCommand;
import com.fpghoti.biscuit.rest.MessageText; import com.fpghoti.biscuit.rest.MessageText;
import net.dv8tion.jda.api.entities.Guild; import net.dv8tion.jda.api.entities.Guild;
import net.dv8tion.jda.api.entities.TextChannel; //import net.dv8tion.jda.api.entities.TextChannel;
import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
public class GuildSayCommand extends ConsoleCommand{ public class GuildSayCommand extends ConsoleCommand{

View File

@ -6,7 +6,8 @@ import com.fpghoti.biscuit.commands.base.ConsoleCommand;
import com.fpghoti.biscuit.rest.MessageText; import com.fpghoti.biscuit.rest.MessageText;
import net.dv8tion.jda.api.entities.Guild; import net.dv8tion.jda.api.entities.Guild;
import net.dv8tion.jda.api.entities.TextChannel; //import net.dv8tion.jda.api.entities.TextChannel;
import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
public class SayCommand extends ConsoleCommand{ public class SayCommand extends ConsoleCommand{

View File

@ -6,6 +6,7 @@ import com.fpghoti.biscuit.commands.base.ClientCommand;
import com.fpghoti.biscuit.rest.MessageText; import com.fpghoti.biscuit.rest.MessageText;
import com.fpghoti.biscuit.util.Util; import com.fpghoti.biscuit.util.Util;
import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
import net.dv8tion.jda.api.events.message.MessageReceivedEvent; import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
public class AddCommand extends ClientCommand{ public class AddCommand extends ClientCommand{
@ -31,7 +32,7 @@ public class AddCommand extends ClientCommand{
if(end.equals(".0")) { if(end.equals(".0")) {
sum = sum.replace(".0",""); sum = sum.replace(".0","");
} }
MessageText.send(event.getTextChannel(), args[0] + " + " + args[1] + " is **" + sum + "**."); MessageText.send(event.getChannel().asTextChannel(), args[0] + " + " + args[1] + " is **" + sum + "**.");
} }
} }

View File

@ -23,7 +23,7 @@ public class ChanIDCommand extends ClientCommand{
Biscuit b = Biscuit.getBiscuit(event.getGuild()); Biscuit b = Biscuit.getBiscuit(event.getGuild());
b.log(event.getAuthor().getName() + " issued a command: -chanid"); b.log(event.getAuthor().getName() + " issued a command: -chanid");
String id = event.getChannel().getId(); String id = event.getChannel().getId();
MessageText.send(event.getTextChannel(), id); MessageText.send(event.getChannel().asTextChannel(), id);
} }
} }

View File

@ -32,7 +32,7 @@ public class DivideCommand extends ClientCommand{
if(end.equals(".0")) { if(end.equals(".0")) {
divide = divide.replace(".0",""); divide = divide.replace(".0","");
} }
MessageText.send(event.getTextChannel(), args[0] + " / " + args[1] + " is **" + divide + "**."); MessageText.send(event.getChannel().asTextChannel(), args[0] + " / " + args[1] + " is **" + divide + "**.");
} }
} }

View File

@ -1,5 +1,7 @@
package com.fpghoti.biscuit.commands.discord; package com.fpghoti.biscuit.commands.discord;
import java.io.File;
import com.fpghoti.biscuit.Main; import com.fpghoti.biscuit.Main;
import com.fpghoti.biscuit.biscuit.Biscuit; import com.fpghoti.biscuit.biscuit.Biscuit;
import com.fpghoti.biscuit.commands.base.ClientCommand; import com.fpghoti.biscuit.commands.base.ClientCommand;
@ -8,6 +10,7 @@ import com.fpghoti.biscuit.rest.MessageText;
import com.fpghoti.biscuit.util.PermUtil; import com.fpghoti.biscuit.util.PermUtil;
import net.dv8tion.jda.api.events.message.MessageReceivedEvent; import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
import net.dv8tion.jda.api.utils.FileUpload;
public class GetConfigCommand extends ClientCommand{ public class GetConfigCommand extends ClientCommand{
@ -25,10 +28,14 @@ public class GetConfigCommand extends ClientCommand{
Biscuit b = Biscuit.getBiscuit(event.getGuild()); Biscuit b = Biscuit.getBiscuit(event.getGuild());
b.log(event.getAuthor().getName() + " issued a command: -getconfig"); b.log(event.getAuthor().getName() + " issued a command: -getconfig");
if(PermUtil.isAdmin(event.getMember())) { if(PermUtil.isAdmin(event.getMember())) {
event.getChannel().sendFile(b.getConfig().getFile(), "config-" + b.getProperties().getGuildCode() + ".properties").queue(); File config = b.getConfig().getFile();
FileUpload confUpload = FileUpload.fromData(config);
confUpload.setName("config-" + b.getProperties().getGuildCode() + ".properties");
//event.getChannel().sendFile(config, "config-" + b.getProperties().getGuildCode() + ".properties").queue();
event.getChannel().asTextChannel().sendFiles(confUpload);
}else { }else {
b.log(BColor.MAGENTA_BOLD + event.getAuthor().getName() + " lacks permission to view the config!"); b.log(BColor.MAGENTA_BOLD + event.getAuthor().getName() + " lacks permission to view the config!");
MessageText.sendTimed(event.getTextChannel(), event.getAuthor().getAsMention() + " You do not have " MessageText.sendTimed(event.getChannel().asTextChannel(), event.getAuthor().getAsMention() + " You do not have "
+ "permission to view the config.", 5); + "permission to view the config.", 5);
} }
} }

View File

@ -25,7 +25,7 @@ public class GuildIDCommand extends ClientCommand{
Biscuit b = Biscuit.getBiscuit(event.getGuild()); Biscuit b = Biscuit.getBiscuit(event.getGuild());
b.log(event.getAuthor().getName() + " issued a command: -guildid"); b.log(event.getAuthor().getName() + " issued a command: -guildid");
if(PermUtil.isMod(event.getMember())) { if(PermUtil.isMod(event.getMember())) {
MessageText.send(event.getTextChannel(), event.getGuild().getId()); MessageText.send(event.getChannel().asTextChannel(), event.getGuild().getId());
} }
} }

View File

@ -36,7 +36,7 @@ public class HelpCommand extends ClientCommand {
if(Util.isDigit(args[0])) { if(Util.isDigit(args[0])) {
pg = Integer.parseInt(args[0]); pg = Integer.parseInt(args[0]);
}else { }else {
MessageText.send(event.getTextChannel(), "Usage: ``" + usage + "``"); MessageText.send(event.getChannel().asTextChannel(), "Usage: ``" + usage + "``");
} }
} }
List<BaseCommand> commands = new ArrayList<BaseCommand>(); List<BaseCommand> commands = new ArrayList<BaseCommand>();
@ -66,8 +66,8 @@ public class HelpCommand extends ClientCommand {
pg = pageCount; pg = pageCount;
} }
MessageText.send(event.getTextChannel(), "**Use " + Main.getMainBiscuit().getProperties().getCommandSignifier() + "help [Page #] to navigate the different pages.**"); MessageText.send(event.getChannel().asTextChannel(), "**Use " + Main.getMainBiscuit().getProperties().getCommandSignifier() + "help [Page #] to navigate the different pages.**");
MessageText.send(event.getTextChannel(), "[" + Integer.toString(pg) + "/" + Integer.toString(pageCount) + "] **Bot Commands:**"); MessageText.send(event.getChannel().asTextChannel(), "[" + Integer.toString(pg) + "/" + Integer.toString(pageCount) + "] **Bot Commands:**");
String msg = ""; String msg = "";
for (int i = 0; i < 8; i++) { for (int i = 0; i < 8; i++) {
int index = (pg - 1) * 8 + i; int index = (pg - 1) * 8 + i;
@ -82,7 +82,7 @@ public class HelpCommand extends ClientCommand {
msg = msg + line; msg = msg + line;
} }
} }
MessageText.send(event.getTextChannel(), msg); MessageText.send(event.getChannel().asTextChannel(), msg);
} }
} }

View File

@ -8,7 +8,8 @@ import com.fpghoti.biscuit.util.PermUtil;
import com.fpghoti.biscuit.util.Util; import com.fpghoti.biscuit.util.Util;
import net.dv8tion.jda.api.entities.Guild; import net.dv8tion.jda.api.entities.Guild;
import net.dv8tion.jda.api.entities.TextChannel; import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
//import net.dv8tion.jda.api.entities.TextChannel;
import net.dv8tion.jda.api.events.message.MessageReceivedEvent; import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
public class MakeInviteCommand extends ClientCommand{ public class MakeInviteCommand extends ClientCommand{
@ -40,7 +41,7 @@ public class MakeInviteCommand extends ClientCommand{
} }
} }
if(doubAge > 86400) { if(doubAge > 86400) {
MessageText.send(event.getTextChannel(), "That length is longer than what Discord allows. Please try again. (Max 24 hours)"); MessageText.send(event.getChannel().asTextChannel(), "That length is longer than what Discord allows. Please try again. (Max 24 hours)");
return; return;
} }
final double db = doubAge; final double db = doubAge;
@ -50,7 +51,7 @@ public class MakeInviteCommand extends ClientCommand{
if(db > 0) { if(db > 0) {
exp = args[1] + " hour(s)"; exp = args[1] + " hour(s)";
} }
MessageText.send(event.getTextChannel(), "Created invite **" + i.getCode() + "** Expiration: **" + exp + "**."); MessageText.send(event.getChannel().asTextChannel(), "Created invite **" + i.getCode() + "** Expiration: **" + exp + "**.");
}); });
} }
} }

View File

@ -32,7 +32,7 @@ public class MultiplyCommand extends ClientCommand{
if(end.equals(".0")) { if(end.equals(".0")) {
prod = prod.replace(".0",""); prod = prod.replace(".0","");
} }
MessageText.send(event.getTextChannel(), args[0] + " x " + args[1] + " is **" + prod + "**."); MessageText.send(event.getChannel().asTextChannel(), args[0] + " x " + args[1] + " is **" + prod + "**.");
} }
} }

View File

@ -25,12 +25,12 @@ public class NotSpammerCommand extends ClientCommand{
public void execute(String[] args, MessageReceivedEvent event) { public void execute(String[] args, MessageReceivedEvent event) {
Biscuit b = Biscuit.getBiscuit(event.getGuild()); Biscuit b = Biscuit.getBiscuit(event.getGuild());
b.log(event.getAuthor().getName() + " issued a command: -notspammer " + args[0]); b.log(event.getAuthor().getName() + " issued a command: -notspammer " + args[0]);
for(Member m : event.getMessage().getMentionedMembers()){ for(Member m : event.getMessage().getMentions().getMembers()){
User u = m.getUser(); User u = m.getUser();
String s = u.getAsMention(); String s = u.getAsMention();
if(event.getChannel().getName().equals("public-spam-test") || (PermUtil.isMod(event.getMember()))) { if(event.getChannel().getName().equals("public-spam-test") || (PermUtil.isMod(event.getMember()))) {
b.getMessageStore().removeSpammer(u); b.getMessageStore().removeSpammer(u);
MessageText.send(event.getTextChannel(), s + " is no longer flagged as spam."); MessageText.send(event.getChannel().asTextChannel(), s + " is no longer flagged as spam.");
} }
} }
} }

View File

@ -22,7 +22,7 @@ public class PingCommand extends ClientCommand{
public void execute(String[] args, MessageReceivedEvent event) { public void execute(String[] args, MessageReceivedEvent event) {
Biscuit b = Biscuit.getBiscuit(event.getGuild()); Biscuit b = Biscuit.getBiscuit(event.getGuild());
b.log(event.getAuthor().getName() + " issued a command: -ping"); b.log(event.getAuthor().getName() + " issued a command: -ping");
MessageText.send(event.getTextChannel(), "Pong!"); MessageText.send(event.getChannel().asTextChannel(), "Pong!");
} }
} }

View File

@ -32,7 +32,7 @@ public class PowerCommand extends ClientCommand{
if(end.equals(".0")) { if(end.equals(".0")) {
pow = pow.replace(".0",""); pow = pow.replace(".0","");
} }
MessageText.send(event.getTextChannel(), args[0] + "^" + args[1] + " is **" + pow + "**."); MessageText.send(event.getChannel().asTextChannel(), args[0] + "^" + args[1] + " is **" + pow + "**.");
} }
} }

View File

@ -23,7 +23,7 @@ public class RecentSpammersCommand extends ClientCommand{
Biscuit b = Biscuit.getBiscuit(event.getGuild()); Biscuit b = Biscuit.getBiscuit(event.getGuild());
b.log(event.getAuthor().getName() + " issued a command: -recentspammers"); b.log(event.getAuthor().getName() + " issued a command: -recentspammers");
String msg = b.getMessageStore().getSpammerList(); String msg = b.getMessageStore().getSpammerList();
MessageText.send(event.getTextChannel(), msg); MessageText.send(event.getChannel().asTextChannel(), msg);
} }

View File

@ -32,21 +32,21 @@ public class SaveConfigCommand extends ClientCommand{
if(!attch.isEmpty()) { if(!attch.isEmpty()) {
if(attch.size() == 1) { if(attch.size() == 1) {
for(Attachment a : attch) { for(Attachment a : attch) {
b.getConfig().replaceConfig(a, event.getTextChannel()); b.getConfig().replaceConfig(a, event.getChannel().asTextChannel());
b.remove(); b.remove();
b = Biscuit.loadGuild(event.getGuild()); b = Biscuit.loadGuild(event.getGuild());
} }
}else { }else {
MessageText.sendTimed(event.getTextChannel(), event.getAuthor().getAsMention() + " Too many attachments added! " MessageText.sendTimed(event.getChannel().asTextChannel(), event.getAuthor().getAsMention() + " Too many attachments added! "
+ "Please only include the config file you want to save.", 5); + "Please only include the config file you want to save.", 5);
} }
}else { }else {
MessageText.sendTimed(event.getTextChannel(), event.getAuthor().getAsMention() + " You need to send " MessageText.sendTimed(event.getChannel().asTextChannel(), event.getAuthor().getAsMention() + " You need to send "
+ "a file in order to save the config.", 5); + "a file in order to save the config.", 5);
} }
}else { }else {
b.log(BColor.MAGENTA_BOLD + event.getAuthor().getName() + " lacks permission to save the config!"); b.log(BColor.MAGENTA_BOLD + event.getAuthor().getName() + " lacks permission to save the config!");
MessageText.sendTimed(event.getTextChannel(), event.getAuthor().getAsMention() + " You do not have " MessageText.sendTimed(event.getChannel().asTextChannel(), event.getAuthor().getAsMention() + " You do not have "
+ "permission to save the config.", 5); + "permission to save the config.", 5);
} }
} }

View File

@ -25,17 +25,17 @@ public class SoftMuteCommand extends ClientCommand{
public void execute(String[] args, MessageReceivedEvent event) { public void execute(String[] args, MessageReceivedEvent event) {
Biscuit b = Biscuit.getBiscuit(event.getGuild()); Biscuit b = Biscuit.getBiscuit(event.getGuild());
b.log(event.getAuthor().getName() + " issued a command: -softmute " + args[0]); b.log(event.getAuthor().getName() + " issued a command: -softmute " + args[0]);
for(Member m : event.getMessage().getMentionedMembers()){ for(Member m : event.getMessage().getMentions().getMembers()){
User u = m.getUser(); User u = m.getUser();
String s = u.getAsMention(); String s = u.getAsMention();
if(b.getMessageStore().isSoftmuted(u)) { if(b.getMessageStore().isSoftmuted(u)) {
MessageText.sendTimed(event.getTextChannel(), s + " is already softmuted.", 3); MessageText.sendTimed(event.getChannel().asTextChannel(), s + " is already softmuted.", 3);
return; return;
} }
if(event.getChannel().getName().equals("public-softmute-test") || (PermUtil.isMod(event.getMember()))) { if(event.getChannel().getName().equals("public-softmute-test") || (PermUtil.isMod(event.getMember()))) {
b.getMessageStore().addSoftmuted(u); b.getMessageStore().addSoftmuted(u);
u.openPrivateChannel().queue(); u.openPrivateChannel().queue();
MessageText.send(event.getTextChannel(), s + " is now soft-muted. They will now be only able to send one message every two minutes."); MessageText.send(event.getChannel().asTextChannel(), s + " is now soft-muted. They will now be only able to send one message every two minutes.");
} }
} }
} }

View File

@ -31,7 +31,7 @@ public class SquareRootCommand extends ClientCommand{
if(end.equals(".0")) { if(end.equals(".0")) {
root = root.replace(".0",""); root = root.replace(".0","");
} }
MessageText.send(event.getTextChannel(), "The sqaure root of " + args[0] + " is **" + root + "**."); MessageText.send(event.getChannel().asTextChannel(), "The sqaure root of " + args[0] + " is **" + root + "**.");
} }
} }

View File

@ -32,7 +32,7 @@ public class SubtractCommand extends ClientCommand{
if(end.equals(".0")) { if(end.equals(".0")) {
sub = sub.replace(".0",""); sub = sub.replace(".0","");
} }
MessageText.send(event.getTextChannel(), args[0] + " - " + args[1] + " is **" + sub + "**."); MessageText.send(event.getChannel().asTextChannel(), args[0] + " - " + args[1] + " is **" + sub + "**.");
} }
} }

View File

@ -6,8 +6,9 @@ import com.fpghoti.biscuit.commands.base.ClientCommand;
import com.fpghoti.biscuit.rest.MessageText; import com.fpghoti.biscuit.rest.MessageText;
import com.fpghoti.biscuit.util.PermUtil; import com.fpghoti.biscuit.util.PermUtil;
import net.dv8tion.jda.api.entities.Emote;
import net.dv8tion.jda.api.entities.Role; import net.dv8tion.jda.api.entities.Role;
import net.dv8tion.jda.api.entities.emoji.Emoji;
import net.dv8tion.jda.api.entities.emoji.EmojiUnion;
import net.dv8tion.jda.api.events.message.MessageReceivedEvent; import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
public class ToggleRoleCommand extends ClientCommand{ public class ToggleRoleCommand extends ClientCommand{
@ -38,7 +39,7 @@ public class ToggleRoleCommand extends ClientCommand{
} }
if(rolename.equals("")) { if(rolename.equals("")) {
MessageText.send(event.getTextChannel(), "Sorry! This role either cannot be toggled or does not exist!"); MessageText.send(event.getChannel().asTextChannel(), "Sorry! This role either cannot be toggled or does not exist!");
return; return;
} }
@ -53,8 +54,8 @@ public class ToggleRoleCommand extends ClientCommand{
return; return;
} }
Emote done = null; Emoji done = null;
for(Emote e : event.getGuild().getEmotes()) { for(Emoji e : event.getMessage().getMentions().getCustomEmojis()) {
if(e.getName().contains(b.getProperties().getDoneEmote())) { if(e.getName().contains(b.getProperties().getDoneEmote())) {
done = e; done = e;
} }
@ -80,7 +81,8 @@ public class ToggleRoleCommand extends ClientCommand{
if(foundEmote) { if(foundEmote) {
event.getMessage().addReaction(done).queue(); event.getMessage().addReaction(done).queue();
}else { }else {
event.getMessage().addReaction("").queue(); //event.getMessage().addReaction("").queue();
event.getMessage().addReaction(Emoji.fromFormatted("U+2714")).queue();
} }
} }
} }

View File

@ -25,10 +25,10 @@ public class UIDCommand extends ClientCommand{
public void execute(String[] args, MessageReceivedEvent event) { public void execute(String[] args, MessageReceivedEvent event) {
Biscuit b = Biscuit.getBiscuit(event.getGuild()); Biscuit b = Biscuit.getBiscuit(event.getGuild());
b.log(event.getAuthor().getName() + " issued a command: -uid " + args[0]); b.log(event.getAuthor().getName() + " issued a command: -uid " + args[0]);
for(Member m : event.getMessage().getMentionedMembers()){ for(Member m : event.getMessage().getMentions().getMembers()){
User u = m.getUser(); User u = m.getUser();
if(PermUtil.isMod(event.getMember())) { if(PermUtil.isMod(event.getMember())) {
MessageText.send(event.getTextChannel(), u.getId()); MessageText.send(event.getChannel().asTextChannel(), u.getId());
} }
} }
} }

View File

@ -25,12 +25,12 @@ public class UnSoftMuteCommand extends ClientCommand{
public void execute(String[] args, MessageReceivedEvent event) { public void execute(String[] args, MessageReceivedEvent event) {
Biscuit b = Biscuit.getBiscuit(event.getGuild()); Biscuit b = Biscuit.getBiscuit(event.getGuild());
b.log(event.getAuthor().getName() + " issued a command: -unsoftmute " + args[0]); b.log(event.getAuthor().getName() + " issued a command: -unsoftmute " + args[0]);
for(Member m : event.getMessage().getMentionedMembers()){ for(Member m : event.getMessage().getMentions().getMembers()){
User u = m.getUser(); User u = m.getUser();
String s = u.getAsMention(); String s = u.getAsMention();
if(event.getChannel().getName().equals("public-softmute-test") || (PermUtil.isMod(event.getMember()))) { if(event.getChannel().getName().equals("public-softmute-test") || (PermUtil.isMod(event.getMember()))) {
b.getMessageStore().removeSoftmuted(u); b.getMessageStore().removeSoftmuted(u);
MessageText.send(event.getTextChannel(), s + " is no longer soft-muted."); MessageText.send(event.getChannel().asTextChannel(), s + " is no longer soft-muted.");
} }
} }
} }

View File

@ -24,7 +24,7 @@ public class WikiCommand extends ClientCommand{
Biscuit b = Biscuit.getBiscuit(event.getGuild()); Biscuit b = Biscuit.getBiscuit(event.getGuild());
b.log(event.getAuthor().getName() + " issued a command: -wiki"); b.log(event.getAuthor().getName() + " issued a command: -wiki");
if(PermUtil.isMod(event.getMember())) { if(PermUtil.isMod(event.getMember())) {
MessageText.send(event.getTextChannel(), "https://git.fpghoti.com/thmsdy/Biscuit/wiki"); MessageText.send(event.getChannel().asTextChannel(), "https://git.fpghoti.com/thmsdy/Biscuit/wiki");
} }
} }

View File

@ -24,7 +24,7 @@ public class ClearCommand extends MusicClientCommand{
Biscuit b = Biscuit.getBiscuit(event.getGuild()); Biscuit b = Biscuit.getBiscuit(event.getGuild());
b.log(event.getAuthor().getName() + " issued a command: -clear"); b.log(event.getAuthor().getName() + " issued a command: -clear");
if(PermUtil.hasMusicControl(event.getMember())) { if(PermUtil.hasMusicControl(event.getMember())) {
MessageText.send(event.getTextChannel(), "Cleared all upcoming songs from the queue."); MessageText.send(event.getChannel().asTextChannel(), "Cleared all upcoming songs from the queue.");
b.getAudioScheduler().getQueue().clear(); b.getAudioScheduler().getQueue().clear();
} }
} }

View File

@ -26,8 +26,8 @@ public class ClearUserSongsCommand extends MusicClientCommand{
Biscuit b = Biscuit.getBiscuit(event.getGuild()); Biscuit b = Biscuit.getBiscuit(event.getGuild());
b.log(event.getAuthor().getName() + " issued a command: -clearusersongs " + args[0]); b.log(event.getAuthor().getName() + " issued a command: -clearusersongs " + args[0]);
if(PermUtil.hasMusicControl(event.getMember())) { if(PermUtil.hasMusicControl(event.getMember())) {
for(Member m : event.getMessage().getMentionedMembers()) { for(Member m : event.getMessage().getMentions().getMembers()) {
MessageText.send(event.getTextChannel(), "Clearing all upcoming tracks added by **" + m.getEffectiveName() + "**."); MessageText.send(event.getChannel().asTextChannel(), "Clearing all upcoming tracks added by **" + m.getEffectiveName() + "**.");
b.getAudioScheduler().getQueue().removeUserTracks(m.getId()); b.getAudioScheduler().getQueue().removeUserTracks(m.getId());
} }
} }

View File

@ -24,8 +24,8 @@ public class ForceSkipCommand extends MusicClientCommand{
Biscuit b = Biscuit.getBiscuit(event.getGuild()); Biscuit b = Biscuit.getBiscuit(event.getGuild());
b.log(event.getAuthor().getName() + " issued a command: -forceskip"); b.log(event.getAuthor().getName() + " issued a command: -forceskip");
if(PermUtil.hasMusicControl(event.getMember())) { if(PermUtil.hasMusicControl(event.getMember())) {
MessageText.send(event.getTextChannel(), "Force skipping current song."); MessageText.send(event.getChannel().asTextChannel(), "Force skipping current song.");
b.getAudioScheduler().skip(event.getTextChannel()); b.getAudioScheduler().skip(event.getChannel().asTextChannel());
} }
} }

View File

@ -28,9 +28,9 @@ public class ForceSkipToCommand extends MusicClientCommand{
if(PermUtil.hasMusicControl(event.getMember())) { if(PermUtil.hasMusicControl(event.getMember())) {
if(Util.isDigit(args[0])) { if(Util.isDigit(args[0])) {
int place = Integer.parseInt(args[0]); int place = Integer.parseInt(args[0]);
MessageText.send(event.getTextChannel(), "Force skipping to queue position **" + place + "**."); MessageText.send(event.getChannel().asTextChannel(), "Force skipping to queue position **" + place + "**.");
b.getAudioScheduler().getQueue().removeTracksBefore(place); b.getAudioScheduler().getQueue().removeTracksBefore(place);
b.getAudioScheduler().skip(event.getTextChannel()); b.getAudioScheduler().skip(event.getChannel().asTextChannel());
} }
} }
} }

View File

@ -25,10 +25,10 @@ public class LoopMusicCommand extends MusicClientCommand{
b.log(event.getAuthor().getName() + " issued a command: -loopmusic"); b.log(event.getAuthor().getName() + " issued a command: -loopmusic");
if(PermUtil.hasMusicControl(event.getMember())) { if(PermUtil.hasMusicControl(event.getMember())) {
if(!b.getAudioScheduler().isLooping()) { if(!b.getAudioScheduler().isLooping()) {
MessageText.send(event.getTextChannel(), "Setting all music to loop."); MessageText.send(event.getChannel().asTextChannel(), "Setting all music to loop.");
b.getAudioScheduler().setLooping(true); b.getAudioScheduler().setLooping(true);
}else { }else {
MessageText.send(event.getTextChannel(), "Disabling music looping."); MessageText.send(event.getChannel().asTextChannel(), "Disabling music looping.");
b.getAudioScheduler().setLooping(false); b.getAudioScheduler().setLooping(false);
} }

View File

@ -28,7 +28,7 @@ public class MoveToCommand extends MusicClientCommand{
if(Util.isDigit(args[0]) && Util.isDigit(args[1])) { if(Util.isDigit(args[0]) && Util.isDigit(args[1])) {
int oldPlace = Integer.parseInt(args[0]); int oldPlace = Integer.parseInt(args[0]);
int newPlace = Integer.parseInt(args[1]); int newPlace = Integer.parseInt(args[1]);
MessageText.send(event.getTextChannel(), "The specified track was moved." ); MessageText.send(event.getChannel().asTextChannel(), "The specified track was moved." );
b.getAudioScheduler().getQueue().moveToPlace(oldPlace, newPlace); b.getAudioScheduler().getQueue().moveToPlace(oldPlace, newPlace);
} }
} }

View File

@ -25,9 +25,9 @@ public class NowPlayingCommand extends MusicClientCommand{
b.log(event.getAuthor().getName() + " issued a command: -nowplaying"); b.log(event.getAuthor().getName() + " issued a command: -nowplaying");
if(b.getAudioScheduler().getQueue().getLastTrack() != null ) { if(b.getAudioScheduler().getQueue().getLastTrack() != null ) {
MessageEmbed next = b.getAudioScheduler().getQueue().getLastTrack().getEmbedMessage("Now Playing:", true); MessageEmbed next = b.getAudioScheduler().getQueue().getLastTrack().getEmbedMessage("Now Playing:", true);
MessageText.send(event.getTextChannel(), next); MessageText.send(event.getChannel().asTextChannel(), next);
}else { }else {
MessageText.send(event.getTextChannel(), "No song is currently playing."); MessageText.send(event.getChannel().asTextChannel(), "No song is currently playing.");
} }
} }

View File

@ -26,9 +26,9 @@ public class PauseCommand extends MusicClientCommand{
if(PermUtil.hasMusicControl(event.getMember())) { if(PermUtil.hasMusicControl(event.getMember())) {
if(!b.getAudioPlayer().isPaused()) { if(!b.getAudioPlayer().isPaused()) {
b.getAudioPlayer().setPaused(true); b.getAudioPlayer().setPaused(true);
MessageText.send(event.getTextChannel(), "Paused the current track."); MessageText.send(event.getChannel().asTextChannel(), "Paused the current track.");
}else { }else {
MessageText.send(event.getTextChannel(), "The music player is already paused."); MessageText.send(event.getChannel().asTextChannel(), "The music player is already paused.");
} }
} }
} }

View File

@ -15,7 +15,8 @@ import com.fpghoti.biscuit.rest.MessageText;
import com.fpghoti.biscuit.util.PermUtil; import com.fpghoti.biscuit.util.PermUtil;
import net.dv8tion.jda.api.entities.Guild; import net.dv8tion.jda.api.entities.Guild;
import net.dv8tion.jda.api.entities.TextChannel; import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
//import net.dv8tion.jda.api.entities.TextChannel;
import net.dv8tion.jda.api.events.message.MessageReceivedEvent; import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
public class PlayFirstCommand extends MusicClientCommand{ public class PlayFirstCommand extends MusicClientCommand{
@ -33,7 +34,7 @@ public class PlayFirstCommand extends MusicClientCommand{
public void execute(String[] args, MessageReceivedEvent event) { public void execute(String[] args, MessageReceivedEvent event) {
Guild guild = event.getGuild(); Guild guild = event.getGuild();
Biscuit b = Biscuit.getBiscuit(guild); Biscuit b = Biscuit.getBiscuit(guild);
TextChannel tchannel = event.getTextChannel(); TextChannel tchannel = event.getChannel().asTextChannel();
int searchArg = 0; int searchArg = 0;
boolean scSearch = false; boolean scSearch = false;

View File

@ -33,7 +33,7 @@ public class QueueCommand extends MusicClientCommand{
if(Util.isDigit(args[0])) { if(Util.isDigit(args[0])) {
pg = Integer.parseInt(args[0]); pg = Integer.parseInt(args[0]);
}else { }else {
MessageText.send(event.getTextChannel(), "Usage: ``" + usage + "``"); MessageText.send(event.getChannel().asTextChannel(), "Usage: ``" + usage + "``");
} }
} }
@ -46,15 +46,15 @@ public class QueueCommand extends MusicClientCommand{
if(queue.size() == 0) { if(queue.size() == 0) {
if(biscuit.getAudioPlayer().getPlayingTrack() == null) { if(biscuit.getAudioPlayer().getPlayingTrack() == null) {
MessageText.send(event.getTextChannel(), "There is currently no song playing."); MessageText.send(event.getChannel().asTextChannel(), "There is currently no song playing.");
}else { }else {
MessageText.send(event.getTextChannel(), "Nothing is queued to play after the current track."); MessageText.send(event.getChannel().asTextChannel(), "Nothing is queued to play after the current track.");
} }
return; return;
} }
MessageText.send(event.getTextChannel(), "**Use " + Main.getMainBiscuit().getProperties().getCommandSignifier() + "queue [Page #] to navigate the different pages.**"); MessageText.send(event.getChannel().asTextChannel(), "**Use " + Main.getMainBiscuit().getProperties().getCommandSignifier() + "queue [Page #] to navigate the different pages.**");
MessageText.send(event.getTextChannel(), "[" + Integer.toString(pg) + "/" + Integer.toString(pageCount) + "] ** Upcoming Music Tracks:**"); MessageText.send(event.getChannel().asTextChannel(), "[" + Integer.toString(pg) + "/" + Integer.toString(pageCount) + "] ** Upcoming Music Tracks:**");
String msg = ""; String msg = "";
for (int i = 0; i < 8; i++) { for (int i = 0; i < 8; i++) {
int index = (pg - 1) * 8 + i; int index = (pg - 1) * 8 + i;
@ -76,7 +76,7 @@ public class QueueCommand extends MusicClientCommand{
msg = msg + line; msg = msg + line;
} }
} }
MessageText.send(event.getTextChannel(), msg); MessageText.send(event.getChannel().asTextChannel(), msg);
} }

View File

@ -27,7 +27,7 @@ public class RemoveCommand extends MusicClientCommand{
if(PermUtil.hasMusicControl(event.getMember())) { if(PermUtil.hasMusicControl(event.getMember())) {
if(Util.isDigit(args[0])) { if(Util.isDigit(args[0])) {
int place = Integer.parseInt(args[0]); int place = Integer.parseInt(args[0]);
MessageText.send(event.getTextChannel(), "Removing track at position **" + place + "**."); MessageText.send(event.getChannel().asTextChannel(), "Removing track at position **" + place + "**.");
b.getAudioScheduler().getQueue().removeTrack(place); b.getAudioScheduler().getQueue().removeTrack(place);
} }
} }

View File

@ -24,9 +24,9 @@ public class ShuffleCommand extends MusicClientCommand{
b.log(event.getAuthor().getName() + " issued a command: -shuffle"); b.log(event.getAuthor().getName() + " issued a command: -shuffle");
if(b.getAudioScheduler().getQueue().getLastTrack() != null ) { if(b.getAudioScheduler().getQueue().getLastTrack() != null ) {
b.getAudioScheduler().getQueue().shuffleUserTracks(event.getAuthor().getId()); b.getAudioScheduler().getQueue().shuffleUserTracks(event.getAuthor().getId());
MessageText.send(event.getTextChannel(), "All songs that you have added to the queue have been shuffled."); MessageText.send(event.getChannel().asTextChannel(), "All songs that you have added to the queue have been shuffled.");
}else { }else {
MessageText.send(event.getTextChannel(), "No song is currently playing."); MessageText.send(event.getChannel().asTextChannel(), "No song is currently playing.");
} }
} }

View File

@ -24,9 +24,9 @@ public class SkipAllCommand extends MusicClientCommand{
Biscuit b = Biscuit.getBiscuit(event.getGuild()); Biscuit b = Biscuit.getBiscuit(event.getGuild());
b.log(event.getAuthor().getName() + " issued a command: -skipall"); b.log(event.getAuthor().getName() + " issued a command: -skipall");
if(PermUtil.hasMusicControl(event.getMember())) { if(PermUtil.hasMusicControl(event.getMember())) {
MessageText.send(event.getTextChannel(), "Force skipping all songs."); MessageText.send(event.getChannel().asTextChannel(), "Force skipping all songs.");
b.getAudioScheduler().getQueue().clear(); b.getAudioScheduler().getQueue().clear();
b.getAudioScheduler().skip(event.getTextChannel()); b.getAudioScheduler().skip(event.getChannel().asTextChannel());
} }
} }

View File

@ -8,10 +8,10 @@ import com.fpghoti.biscuit.biscuit.Biscuit;
import com.fpghoti.biscuit.commands.base.MusicClientCommand; import com.fpghoti.biscuit.commands.base.MusicClientCommand;
import com.fpghoti.biscuit.rest.MessageText; import com.fpghoti.biscuit.rest.MessageText;
import net.dv8tion.jda.api.entities.AudioChannel;
import net.dv8tion.jda.api.entities.Guild; import net.dv8tion.jda.api.entities.Guild;
import net.dv8tion.jda.api.entities.Member; import net.dv8tion.jda.api.entities.Member;
import net.dv8tion.jda.api.entities.TextChannel; import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
import net.dv8tion.jda.api.entities.channel.middleman.AudioChannel;
import net.dv8tion.jda.api.events.message.MessageReceivedEvent; import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
public class SkipCommand extends MusicClientCommand{ public class SkipCommand extends MusicClientCommand{
@ -32,11 +32,11 @@ public class SkipCommand extends MusicClientCommand{
Biscuit biscuit = Biscuit.getBiscuit(guild); Biscuit biscuit = Biscuit.getBiscuit(guild);
biscuit.log(event.getAuthor().getName() + " issued a command: -skip"); biscuit.log(event.getAuthor().getName() + " issued a command: -skip");
TextChannel cmdChannel = event.getTextChannel(); TextChannel cmdChannel = event.getChannel().asTextChannel();
//Bot is not connected to voice channel. Do nothing. //Bot is not connected to voice channel. Do nothing.
if(!guild.getAudioManager().isConnected()) { if(!guild.getAudioManager().isConnected()) {
MessageText.send(event.getTextChannel(), "The music player is not connected to a voice channel!"); MessageText.send(event.getChannel().asTextChannel(), "The music player is not connected to a voice channel!");
return; return;
} }

View File

@ -27,10 +27,10 @@ public class TogglePauseCommand extends MusicClientCommand{
if(PermUtil.hasMusicControl(event.getMember())) { if(PermUtil.hasMusicControl(event.getMember())) {
if(b.getAudioPlayer().isPaused()) { if(b.getAudioPlayer().isPaused()) {
b.getAudioPlayer().setPaused(false); b.getAudioPlayer().setPaused(false);
MessageText.send(event.getTextChannel(), "Unpaused the current track."); MessageText.send(event.getChannel().asTextChannel(), "Unpaused the current track.");
}else { }else {
b.getAudioPlayer().setPaused(true); b.getAudioPlayer().setPaused(true);
MessageText.send(event.getTextChannel(), "Paused the current track."); MessageText.send(event.getChannel().asTextChannel(), "Paused the current track.");
} }
} }
} }

View File

@ -27,9 +27,9 @@ public class UnpauseCommand extends MusicClientCommand{
if(PermUtil.hasMusicControl(event.getMember())) { if(PermUtil.hasMusicControl(event.getMember())) {
if(b.getAudioPlayer().isPaused()) { if(b.getAudioPlayer().isPaused()) {
b.getAudioPlayer().setPaused(false); b.getAudioPlayer().setPaused(false);
MessageText.send(event.getTextChannel(), "Unpaused the current track."); MessageText.send(event.getChannel().asTextChannel(), "Unpaused the current track.");
}else { }else {
MessageText.send(event.getTextChannel(), "The music player is not paused."); MessageText.send(event.getChannel().asTextChannel(), "The music player is not paused.");
} }
} }
} }

View File

@ -27,7 +27,7 @@ public class VolumeCommand extends MusicClientCommand{
if(args.length < 1) { if(args.length < 1) {
b.log(event.getAuthor().getName() + " issued a command: -volume"); b.log(event.getAuthor().getName() + " issued a command: -volume");
MessageText.send(event.getTextChannel(), "The current volume is: **" + b.getAudioPlayer().getVolume() + "**."); MessageText.send(event.getChannel().asTextChannel(), "The current volume is: **" + b.getAudioPlayer().getVolume() + "**.");
return; return;
} }
@ -42,7 +42,7 @@ public class VolumeCommand extends MusicClientCommand{
vol = 150; vol = 150;
} }
b.getAudioPlayer().setVolume(vol); b.getAudioPlayer().setVolume(vol);
MessageText.send(event.getTextChannel(), "The volume was set to **" + b.getAudioPlayer().getVolume() + "**."); MessageText.send(event.getChannel().asTextChannel(), "The volume was set to **" + b.getAudioPlayer().getVolume() + "**.");
} }
} }
} }

View File

@ -20,7 +20,7 @@ import com.jcabi.aspects.Async;
import net.dv8tion.jda.api.entities.Guild; import net.dv8tion.jda.api.entities.Guild;
import net.dv8tion.jda.api.entities.Message.Attachment; import net.dv8tion.jda.api.entities.Message.Attachment;
import net.dv8tion.jda.api.entities.TextChannel; import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
public class BiscuitConfig { public class BiscuitConfig {
@ -74,7 +74,7 @@ public class BiscuitConfig {
return; return;
} }
File config = new File(biscuit.getConfigDir(), name); File config = new File(biscuit.getConfigDir(), name);
a.downloadToFile(config).thenAccept(file -> { a.getProxy().downloadToFile(config).thenAccept(file -> {
updateConfig(file, true, code); updateConfig(file, true, code);
MessageText.send(c, "**The config was successfully updated.**"); MessageText.send(c, "**The config was successfully updated.**");
}).exceptionally(t -> { }).exceptionally(t -> {
@ -82,6 +82,7 @@ public class BiscuitConfig {
MessageText.send(c, "**An Exception occurred while trying to read the file.**"); MessageText.send(c, "**An Exception occurred while trying to read the file.**");
return null; return null;
}); });
return; return;
} }
@ -135,6 +136,7 @@ public class BiscuitConfig {
added = addProperty("Bot-Token", "", prop, added, silent); added = addProperty("Bot-Token", "", prop, added, silent);
added = addProperty("Enable-Music-Bot", "true", prop, added, silent); added = addProperty("Enable-Music-Bot", "true", prop, added, silent);
added = addProperty("Log-Music-Player", "true", prop, added, silent); added = addProperty("Log-Music-Player", "true", prop, added, silent);
added = addProperty("Powershell-Display-Mode", "false", prop, added, silent);
} }
added = addProperty("Guild-Identifier", name, prop, added, silent); added = addProperty("Guild-Identifier", name, prop, added, silent);

View File

@ -32,6 +32,11 @@ public class BiscuitProperties {
return Main.getMainBiscuit().getConfig().getFromConfig(key).equalsIgnoreCase("true"); return Main.getMainBiscuit().getConfig().getFromConfig(key).equalsIgnoreCase("true");
} }
public boolean isPowerShell(){
String key = "Powershell-Display-Mode";
return Main.getMainBiscuit().getConfig().getFromConfig(key).equalsIgnoreCase("true");
}
public boolean allowMusicBot(){ public boolean allowMusicBot(){
if(!musicBotEnabled()) { if(!musicBotEnabled()) {
return false; return false;

View File

@ -4,19 +4,19 @@ import java.util.Scanner;
import com.fpghoti.biscuit.biscuit.Biscuit; import com.fpghoti.biscuit.biscuit.Biscuit;
import com.fpghoti.biscuit.commands.CommandManager; import com.fpghoti.biscuit.commands.CommandManager;
import com.fpghoti.biscuit.logging.BiscuitLog; import com.fpghoti.biscuit.logging.BiscuitLogger;
import com.fpghoti.biscuit.util.PermUtil; import com.fpghoti.biscuit.util.PermUtil;
import net.dv8tion.jda.api.entities.TextChannel; import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
import net.dv8tion.jda.api.events.message.MessageReceivedEvent; import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
import net.dv8tion.jda.api.hooks.ListenerAdapter; import net.dv8tion.jda.api.hooks.ListenerAdapter;
public class CommandListener extends ListenerAdapter implements Runnable { public class CommandListener extends ListenerAdapter implements Runnable {
private Scanner sc; private Scanner sc;
private BiscuitLog log; private BiscuitLogger log;
public CommandListener(Scanner sc, BiscuitLog log) { public CommandListener(Scanner sc, BiscuitLogger log) {
this.sc = sc; this.sc = sc;
this.log = log; this.log = log;
} }
@ -27,7 +27,7 @@ public class CommandListener extends ListenerAdapter implements Runnable {
return; return;
} }
Biscuit b = Biscuit.getBiscuit(event.getGuild()); Biscuit b = Biscuit.getBiscuit(event.getGuild());
if(PermUtil.isAdmin(event.getMember()) || !b.getProperties().restrictCmdChannels() || (b.getProperties().restrictCmdChannels() && isBotChannel(event.getTextChannel()))) { if(PermUtil.isAdmin(event.getMember()) || !b.getProperties().restrictCmdChannels() || (b.getProperties().restrictCmdChannels() && isBotChannel(event.getChannel().asTextChannel()))) {
if(!event.getAuthor().isBot() && event.getMessage().getContentDisplay().startsWith(b.getProperties().getCommandSignifier()) && event.getMessage().getAuthor().getId() != event.getJDA().getSelfUser().getId()){ if(!event.getAuthor().isBot() && event.getMessage().getContentDisplay().startsWith(b.getProperties().getCommandSignifier()) && event.getMessage().getAuthor().getId() != event.getJDA().getSelfUser().getId()){
CommandManager.parse(event.getMessage().getContentRaw().toLowerCase(), event); CommandManager.parse(event.getMessage().getContentRaw().toLowerCase(), event);
} }

View File

@ -4,7 +4,7 @@ import com.fpghoti.biscuit.Main;
import com.fpghoti.biscuit.captcha.HandleCaptcha; import com.fpghoti.biscuit.captcha.HandleCaptcha;
import com.fpghoti.biscuit.logging.BColor; import com.fpghoti.biscuit.logging.BColor;
import net.dv8tion.jda.api.entities.ChannelType; import net.dv8tion.jda.api.entities.channel.ChannelType;
import net.dv8tion.jda.api.events.message.MessageReceivedEvent; import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
import net.dv8tion.jda.api.hooks.ListenerAdapter; import net.dv8tion.jda.api.hooks.ListenerAdapter;

View File

@ -12,7 +12,7 @@ public class MessageDeleteListener extends ListenerAdapter {
@Override @Override
public void onMessageDelete(MessageDeleteEvent event) { public void onMessageDelete(MessageDeleteEvent event) {
Biscuit biscuit = Biscuit.getBiscuit(event.getGuild()); Biscuit biscuit = Biscuit.getBiscuit(event.getGuild());
if(Util.isLoggable(event.getTextChannel())) { if(Util.isLoggable(event.getChannel().asTextChannel())) {
biscuit.log("[" + BColor.MAGENTA + "#" + event.getChannel().getName() + BColor.RESET + "] " + BColor.MAGENTA_BOLD + "Message " + event.getMessageId() + " was deleted."); biscuit.log("[" + BColor.MAGENTA + "#" + event.getChannel().getName() + BColor.RESET + "] " + BColor.MAGENTA_BOLD + "Message " + event.getMessageId() + " was deleted.");
} }
} }

View File

@ -12,7 +12,7 @@ public class MessageEditListener extends ListenerAdapter {
@Override @Override
public void onMessageUpdate(MessageUpdateEvent event) { public void onMessageUpdate(MessageUpdateEvent event) {
Biscuit biscuit = Biscuit.getBiscuit(event.getGuild()); Biscuit biscuit = Biscuit.getBiscuit(event.getGuild());
if(Util.isLoggable(event.getTextChannel()) && (!event.getAuthor().getName().equalsIgnoreCase("jbot") && !event.getAuthor().isBot())) { if(Util.isLoggable(event.getChannel().asTextChannel()) && (!event.getAuthor().getName().equalsIgnoreCase("jbot") && !event.getAuthor().isBot())) {
biscuit.log("[" + BColor.CYAN_BOLD + "MSG EDIT" + BColor.RESET + "] " + BColor.CYAN + "ID: " + BColor.RESET + biscuit.log("[" + BColor.CYAN_BOLD + "MSG EDIT" + BColor.RESET + "] " + BColor.CYAN + "ID: " + BColor.RESET +
event.getMessageId() + BColor.CYAN + " User: " + BColor.RESET + event.getAuthor().getAsMention()); event.getMessageId() + BColor.CYAN + " User: " + BColor.RESET + event.getAuthor().getAsMention());
biscuit.log("[" + BColor.CYAN_BOLD + "#" + event.getChannel().getName() + BColor.RESET + "] " + BColor.CYAN + event.getAuthor().getName() + ": " + BColor.WHITE_BOLD + event.getMessage().getContentDisplay()); biscuit.log("[" + BColor.CYAN_BOLD + "#" + event.getChannel().getName() + BColor.RESET + "] " + BColor.CYAN + event.getAuthor().getName() + ": " + BColor.WHITE_BOLD + event.getMessage().getContentDisplay());

View File

@ -42,14 +42,14 @@ public class MessageReceiveListener extends ListenerAdapter{
} }
//Channel is a captcha channel //Channel is a captcha channel
if(HandleCaptcha.isCaptchaChannel(event.getTextChannel())) { if(HandleCaptcha.isCaptchaChannel(event.getChannel().asTextChannel())) {
HandleCaptcha.handleCaptcha(event.getAuthor(), event.getChannel(), event.getMessage().getContentDisplay()); HandleCaptcha.handleCaptcha(event.getAuthor(), event.getChannel(), event.getMessage().getContentDisplay());
} }
} }
private void logBot(MessageReceivedEvent event, Biscuit biscuit) { private void logBot(MessageReceivedEvent event, Biscuit biscuit) {
if(Util.isLoggable(event.getTextChannel())) { if(Util.isLoggable(event.getChannel().asTextChannel())) {
if(biscuit.getProperties().logChat()) { if(biscuit.getProperties().logChat()) {
biscuit.log("[" + BColor.BLACK_BOLD + "BOT" + BColor.RESET + "] [" + BColor.RED + "#" + event.getChannel().getName() + BColor.RESET + "] " biscuit.log("[" + BColor.BLACK_BOLD + "BOT" + BColor.RESET + "] [" + BColor.RED + "#" + event.getChannel().getName() + BColor.RESET + "] "
+ BColor.RED_BOLD + event.getAuthor().getName() + ": " + BColor.RESET + event.getMessage().getContentDisplay()); + BColor.RED_BOLD + event.getAuthor().getName() + ": " + BColor.RESET + event.getMessage().getContentDisplay());
@ -58,7 +58,7 @@ public class MessageReceiveListener extends ListenerAdapter{
} }
private void logUser(MessageReceivedEvent event, Biscuit biscuit) { private void logUser(MessageReceivedEvent event, Biscuit biscuit) {
if(Util.isLoggable(event.getTextChannel())) { if(Util.isLoggable(event.getChannel().asTextChannel())) {
if(biscuit.getProperties().logChat()) { if(biscuit.getProperties().logChat()) {
biscuit.log("[" + BColor.CYAN_BOLD + "MSG" + BColor.RESET + "] " + BColor.GREEN + "ID: " + BColor.RESET + biscuit.log("[" + BColor.CYAN_BOLD + "MSG" + BColor.RESET + "] " + BColor.GREEN + "ID: " + BColor.RESET +
event.getMessageId() + BColor.GREEN + " Sender: " + BColor.RESET + event.getAuthor().getAsMention()); event.getMessageId() + BColor.GREEN + " Sender: " + BColor.RESET + event.getAuthor().getAsMention());
@ -83,7 +83,7 @@ public class MessageReceiveListener extends ListenerAdapter{
private boolean isNaughty(MessageReceivedEvent event) { private boolean isNaughty(MessageReceivedEvent event) {
// TODO make staff filter configurable // TODO make staff filter configurable
if(!event.getChannel().getName().toLowerCase().contains("staff") && ChatFilter.filter(event, false)){ if(!event.getChannel().getName().toLowerCase().contains("staff") && ChatFilter.filter(event, false)){
MessageText.sendTimed(event.getTextChannel(), event.getAuthor().getAsMention() + " This message contains words not appropriate for this channel.", 3); MessageText.sendTimed(event.getChannel().asTextChannel(), event.getAuthor().getAsMention() + " This message contains words not appropriate for this channel.", 3);
event.getMessage().delete().submit(); event.getMessage().delete().submit();
return true; return true;
} }
@ -151,14 +151,14 @@ public class MessageReceiveListener extends ListenerAdapter{
store.addSpammer(event.getAuthor()); store.addSpammer(event.getAuthor());
store.removeSpamWarned(event.getAuthor()); store.removeSpamWarned(event.getAuthor());
event.getMessage().delete().submit(); event.getMessage().delete().submit();
MessageText.sendTimed(event.getTextChannel(), "*Flagging " + mention + " as spam!*", 3); MessageText.sendTimed(event.getChannel().asTextChannel(), "*Flagging " + mention + " as spam!*", 3);
biscuit.log(BColor.MAGENTA_BOLD + "User " + event.getAuthor().getName() + " has been flagged as spam!"); biscuit.log(BColor.MAGENTA_BOLD + "User " + event.getAuthor().getName() + " has been flagged as spam!");
event.getMessage().delete().reason("Spam removal activated for " + mention).submit(); event.getMessage().delete().reason("Spam removal activated for " + mention).submit();
//User is spamming and has not been warned. Apply warning. //User is spamming and has not been warned. Apply warning.
}else if(!store.isSpammer(event.getAuthor()) && !store.isSpamWarned(event.getAuthor())){ }else if(!store.isSpammer(event.getAuthor()) && !store.isSpamWarned(event.getAuthor())){
store.removeMessageCount(event.getAuthor()); store.removeMessageCount(event.getAuthor());
store.addSpamWarned(event.getAuthor()); store.addSpamWarned(event.getAuthor());
MessageText.sendTimed(event.getTextChannel(), "**STOP spamming, " + mention + "! You have been warned!**", 3); MessageText.sendTimed(event.getChannel().asTextChannel(), "**STOP spamming, " + mention + "! You have been warned!**", 3);
biscuit.log(BColor.MAGENTA_BOLD + "User " + event.getAuthor().getName() + " has been warned for spam!"); biscuit.log(BColor.MAGENTA_BOLD + "User " + event.getAuthor().getName() + " has been warned for spam!");
} }
} }

View File

@ -21,7 +21,7 @@ public class ReactionListener extends ListenerAdapter{
if(event.getGuild() == null) { if(event.getGuild() == null) {
return; return;
} }
if(Util.contains(biscuit.getProperties().getToggleChannels(),event.getTextChannel().getName())) { if(Util.contains(biscuit.getProperties().getToggleChannels(),event.getChannel().asTextChannel().getName())) {
handleMessageRole(event, false); handleMessageRole(event, false);
} }
} }
@ -32,14 +32,14 @@ public class ReactionListener extends ListenerAdapter{
if(event.getGuild() == null) { if(event.getGuild() == null) {
return; return;
} }
if(Util.contains(biscuit.getProperties().getToggleChannels(),event.getTextChannel().getName())) { if(Util.contains(biscuit.getProperties().getToggleChannels(),event.getChannel().asTextChannel().getName())) {
handleMessageRole(event, true); handleMessageRole(event, true);
} }
} }
private void handleMessageRole(GenericMessageReactionEvent event, boolean remove) { private void handleMessageRole(GenericMessageReactionEvent event, boolean remove) {
Biscuit biscuit = Biscuit.getBiscuit(event.getGuild()); Biscuit biscuit = Biscuit.getBiscuit(event.getGuild());
event.getTextChannel().retrieveMessageById(event.getMessageId()).queue((message) -> { event.getChannel().asTextChannel().retrieveMessageById(event.getMessageId()).queue((message) -> {
String msg = message.getContentDisplay(); String msg = message.getContentDisplay();
for(String rolename : biscuit.getProperties().getToggleRoles()) { for(String rolename : biscuit.getProperties().getToggleRoles()) {
for(Role r : event.getGuild().getRoles()) { for(Role r : event.getGuild().getRoles()) {
@ -65,7 +65,7 @@ public class ReactionListener extends ListenerAdapter{
Member m = event.getMember(); Member m = event.getMember();
if(remove) { if(remove) {
if(PermUtil.hasRole(m, role)) { if(PermUtil.hasRole(m, role)) {
biscuit.log(BColor.MAGENTA_BOLD + "REACTION TOGGLE (#" + event.getTextChannel().getName() + ") - " + BColor.RESET + "Removing role " + role.getName() + " from " + m.getUser().getName() + "(" + m.getId() + ")"); biscuit.log(BColor.MAGENTA_BOLD + "REACTION TOGGLE (#" + event.getChannel().asTextChannel().getName() + ") - " + BColor.RESET + "Removing role " + role.getName() + " from " + m.getUser().getName() + "(" + m.getId() + ")");
guild.removeRoleFromMember(m, role).queue(); guild.removeRoleFromMember(m, role).queue();
} }
}else { }else {
@ -80,7 +80,7 @@ public class ReactionListener extends ListenerAdapter{
canAdd = true; canAdd = true;
} }
if(canAdd) { if(canAdd) {
biscuit.log(BColor.MAGENTA_BOLD + "REACTION TOGGLE (#" + event.getTextChannel().getName() + ") - " + BColor.RESET + " Adding role " + role.getName() + " to " + m.getUser().getName() + "(" + m.getId() + ")"); biscuit.log(BColor.MAGENTA_BOLD + "REACTION TOGGLE (#" + event.getChannel().asTextChannel().getName() + ") - " + BColor.RESET + " Adding role " + role.getName() + " to " + m.getUser().getName() + "(" + m.getId() + ")");
guild.addRoleToMember(m, role).queue(); guild.addRoleToMember(m, role).queue();
} }
} }

View File

@ -1,48 +0,0 @@
package com.fpghoti.biscuit.logging;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.fpghoti.biscuit.Main;
public class BiscuitLog {
private final Logger console = LoggerFactory.getLogger("Biscuit");
private final Logger file = LoggerFactory.getLogger("B-File");
public void debug(String msg) {
console.debug("[" + BColor.MAGENTA_BOLD + "DEBUG" + BColor.RESET + "] " + BColor.MAGENTA + msg + BColor.RESET);
if(!Main.isPlugin) {
file.debug(BColor.clear(msg));
}
}
public void error(String msg) {
console.error("[" + BColor.RED_BOLD + "ERROR" + BColor.RESET + "] " + BColor.RED + msg + BColor.RESET);
if(!Main.isPlugin) {
file.error(BColor.clear(msg));
}
}
public void info(String msg) {
console.info(msg + BColor.RESET);
if(!Main.isPlugin) {
file.info(BColor.clear(msg));
}
}
public void trace(String msg) {
console.trace("[" + BColor.CYAN_BOLD + "TRACE" + BColor.RESET + "] " + BColor.CYAN + msg + BColor.RESET);
if(!Main.isPlugin) {
file.trace(BColor.clear(msg));
}
}
public void warn(String msg) {
console.warn("[" + BColor.YELLOW_BOLD + "WARN" + BColor.RESET + "] " + BColor.YELLOW + msg + BColor.RESET);
if(!Main.isPlugin) {
file.warn(BColor.clear(msg));
}
}
}

View File

@ -0,0 +1,58 @@
package com.fpghoti.biscuit.logging;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.fpghoti.biscuit.Main;
public class BiscuitLogger {
private final Logger console = LoggerFactory.getLogger("Biscuit");
private final Logger file = LoggerFactory.getLogger("B-File");
public void debug(String msg) {
console.debug(powerShellCompat("[" + BColor.MAGENTA_BOLD + "DEBUG" + BColor.RESET + "] " + BColor.MAGENTA + msg + BColor.RESET));
if(!Main.isPlugin) {
file.debug(BColor.clear(msg));
}
}
public void error(String msg) {
console.error(powerShellCompat("[" + BColor.RED_BOLD + "ERROR" + BColor.RESET + "] " + BColor.RED + msg + BColor.RESET));
if(!Main.isPlugin) {
file.error(BColor.clear(msg));
}
}
public void info(String msg) {
console.info(powerShellCompat(msg + BColor.RESET));
if(!Main.isPlugin) {
file.info(BColor.clear(msg));
}
}
public void trace(String msg) {
console.trace(powerShellCompat("[" + BColor.CYAN_BOLD + "TRACE" + BColor.RESET + "] " + BColor.CYAN + msg + BColor.RESET));
if(!Main.isPlugin) {
file.trace(BColor.clear(msg));
}
}
public void warn(String msg) {
console.warn(powerShellCompat("[" + BColor.YELLOW_BOLD + "WARN" + BColor.RESET + "] " + BColor.YELLOW + msg + BColor.RESET));
if(!Main.isPlugin) {
file.warn(BColor.clear(msg));
}
}
private String powerShellCompat(String s) {
if(Main.getMainBiscuit() == null || Main.getMainBiscuit().getProperties() == null) {
return s;
}
if(Main.getMainBiscuit().getProperties().isPowerShell()) {
s = s.replace(BColor.MAGENTA + "", BColor.RED_BOLD + "");
}
return s;
}
}

View File

@ -7,7 +7,7 @@ import org.pf4j.PluginWrapper;
import com.fpghoti.biscuit.Main; import com.fpghoti.biscuit.Main;
import com.fpghoti.biscuit.biscuit.Biscuit; import com.fpghoti.biscuit.biscuit.Biscuit;
import com.fpghoti.biscuit.logging.BiscuitLog; import com.fpghoti.biscuit.logging.BiscuitLogger;
import com.github.cage.Cage; import com.github.cage.Cage;
import com.sedmelluq.discord.lavaplayer.player.AudioPlayerManager; import com.sedmelluq.discord.lavaplayer.player.AudioPlayerManager;
@ -59,7 +59,7 @@ public abstract class BiscuitPlugin extends Plugin {
return Main.getPlayerManager(); return Main.getPlayerManager();
} }
public BiscuitLog getLogger() { public BiscuitLogger getLogger() {
return Main.getLogger(); return Main.getLogger();
} }

View File

@ -6,8 +6,8 @@ import com.fpghoti.biscuit.Main;
import com.fpghoti.biscuit.biscuit.Biscuit; import com.fpghoti.biscuit.biscuit.Biscuit;
import net.dv8tion.jda.api.entities.MessageEmbed; import net.dv8tion.jda.api.entities.MessageEmbed;
import net.dv8tion.jda.api.entities.PrivateChannel; import net.dv8tion.jda.api.entities.channel.concrete.PrivateChannel;
import net.dv8tion.jda.api.entities.TextChannel; import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;;
public class MessageText { public class MessageText {

View File

@ -9,8 +9,8 @@ import com.fpghoti.biscuit.captcha.Captcha;
import net.dv8tion.jda.api.JDA; import net.dv8tion.jda.api.JDA;
import net.dv8tion.jda.api.entities.Guild; import net.dv8tion.jda.api.entities.Guild;
import net.dv8tion.jda.api.entities.MessageChannel;
import net.dv8tion.jda.api.entities.User; import net.dv8tion.jda.api.entities.User;
import net.dv8tion.jda.api.entities.channel.middleman.MessageChannel;
public class CaptchaUser implements Iterable<PreUser>{ public class CaptchaUser implements Iterable<PreUser>{

View File

@ -4,7 +4,7 @@ import com.fpghoti.biscuit.biscuit.Biscuit;
import com.fpghoti.biscuit.logging.BColor; import com.fpghoti.biscuit.logging.BColor;
import com.vdurmont.emoji.EmojiParser; import com.vdurmont.emoji.EmojiParser;
import net.dv8tion.jda.api.entities.Emote; import net.dv8tion.jda.api.entities.emoji.Emoji;
import net.dv8tion.jda.api.events.message.MessageReceivedEvent; import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
public class ChatFilter { public class ChatFilter {
@ -36,7 +36,7 @@ public class ChatFilter {
} }
//Custom emote check //Custom emote check
for(Emote e : event.getMessage().getEmotes()) { for(Emoji e : event.getMessage().getMentions().getCustomEmojis()) {
String name = e.getName(); String name = e.getName();
for(String s : biscuit.getProperties().blockedCustomEmotes()) { for(String s : biscuit.getProperties().blockedCustomEmotes()) {

View File

@ -4,7 +4,7 @@ import java.util.Random;
import com.fpghoti.biscuit.biscuit.Biscuit; import com.fpghoti.biscuit.biscuit.Biscuit;
import net.dv8tion.jda.api.entities.TextChannel; import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
public class Util { public class Util {
public static int randInt(int min, int max) { public static int randInt(int min, int max) {

View File

@ -1,13 +1,11 @@
<configuration> <configuration>
<property scope="context" name="COLORIZER_COLORS" <property scope="context" name="COLORIZER_COLORS"
value="boldred@,boldyellow@,boldcyan@,boldmagenta@,boldwhite@" /> value="boldred@,boldyellow@,boldcyan@,boldmagenta@,boldwhite@" />
<conversionRule conversionWord="colorize"
converterClass="org.tuxdude.logback.extensions.LogColorizer" />
<appender name="STDOUT" <appender name="STDOUT"
class="ch.qos.logback.core.ConsoleAppender"> class="ch.qos.logback.core.ConsoleAppender">
<encoder> <encoder>
<pattern>%colorize([%date{MM/dd/yyyy HH:mm:ss}]) %msg%n</pattern> <pattern>[%date{MM/dd/yyyy HH:mm:ss}] %msg%n</pattern>
</encoder> </encoder>
</appender> </appender>