begin update to newer JDA
This commit is contained in:
@@ -65,7 +65,7 @@ import com.fpghoti.biscuit.listener.NicknameListener;
|
||||
import com.fpghoti.biscuit.listener.ReactionListener;
|
||||
import com.fpghoti.biscuit.listener.RoleListener;
|
||||
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.github.cage.Cage;
|
||||
import com.sedmelluq.discord.lavaplayer.player.AudioPlayerManager;
|
||||
@@ -90,7 +90,7 @@ public class Main {
|
||||
public RollingFileAppender<String> we;
|
||||
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 Biscuit mainBiscuit;
|
||||
@@ -224,8 +224,7 @@ public class Main {
|
||||
shardm = DefaultShardManagerBuilder.createDefault(token)
|
||||
.setChunkingFilter(ChunkingFilter.ALL)
|
||||
.setMemberCachePolicy(MemberCachePolicy.ALL)
|
||||
.enableIntents(GatewayIntent.getIntents(GatewayIntent.DEFAULT))
|
||||
.enableIntents(GatewayIntent.GUILD_MEMBERS)
|
||||
.enableIntents(GatewayIntent.getIntents(GatewayIntent.ALL_INTENTS))
|
||||
.build();
|
||||
jda = shardm.getShardById(0);
|
||||
try {
|
||||
@@ -297,7 +296,7 @@ public class Main {
|
||||
return cage;
|
||||
}
|
||||
|
||||
public static BiscuitLog getLogger() {
|
||||
public static BiscuitLogger getLogger() {
|
||||
return log;
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ import com.sedmelluq.discord.lavaplayer.track.AudioTrack;
|
||||
import com.sedmelluq.discord.lavaplayer.track.AudioTrackEndReason;
|
||||
|
||||
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 {
|
||||
|
||||
|
||||
@@ -4,8 +4,8 @@ import com.fpghoti.biscuit.biscuit.Biscuit;
|
||||
import com.fpghoti.biscuit.rest.MessageText;
|
||||
|
||||
import net.dv8tion.jda.api.entities.Guild;
|
||||
import net.dv8tion.jda.api.entities.TextChannel;
|
||||
import net.dv8tion.jda.api.entities.VoiceChannel;
|
||||
import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
|
||||
import net.dv8tion.jda.api.entities.channel.concrete.VoiceChannel;
|
||||
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
|
||||
import net.dv8tion.jda.api.managers.AudioManager;
|
||||
|
||||
@@ -17,7 +17,7 @@ public class PlayCommandUtil {
|
||||
}
|
||||
Guild guild = event.getGuild();
|
||||
Biscuit biscuit = Biscuit.getBiscuit(guild);
|
||||
TextChannel textChannel = event.getTextChannel();
|
||||
TextChannel textChannel = event.getChannel().asTextChannel();
|
||||
|
||||
String vcname = "";
|
||||
if(!event.getMember().getVoiceState().inAudioChannel()) {
|
||||
|
||||
@@ -8,7 +8,7 @@ import com.fpghoti.biscuit.rest.MessageText;
|
||||
import com.sedmelluq.discord.lavaplayer.track.AudioTrack;
|
||||
|
||||
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 {
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import com.sedmelluq.discord.lavaplayer.track.AudioTrack;
|
||||
import net.dv8tion.jda.api.EmbedBuilder;
|
||||
import net.dv8tion.jda.api.entities.Member;
|
||||
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 {
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import com.fpghoti.biscuit.audio.request.youtube.YTRequest;
|
||||
import com.fpghoti.biscuit.biscuit.Biscuit;
|
||||
|
||||
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 {
|
||||
|
||||
@@ -42,7 +42,7 @@ public abstract class PlayRequest {
|
||||
case YOUTUBE_PRIORITY:
|
||||
return new YTPriorityRequest(message, searchPhrase, insertSlot);
|
||||
case YOUTUBE_IMMEDIATE:
|
||||
return new YTImmediateRequest(message.getTextChannel(), message.getAuthor().getId(), searchPhrase);
|
||||
return new YTImmediateRequest(message.getChannel().asTextChannel(), message.getAuthor().getId(), searchPhrase);
|
||||
case SOUNDCLOUD:
|
||||
return new SCRequest(message, searchPhrase);
|
||||
case SOUNDCLOUD_PRIORITY:
|
||||
@@ -58,7 +58,7 @@ public abstract class PlayRequest {
|
||||
private 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) {
|
||||
|
||||
@@ -3,14 +3,14 @@ package com.fpghoti.biscuit.audio.request.soundcloud;
|
||||
import com.fpghoti.biscuit.audio.request.RequestType;
|
||||
|
||||
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{
|
||||
|
||||
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) {
|
||||
|
||||
@@ -4,14 +4,14 @@ import com.fpghoti.biscuit.audio.request.PlayRequest;
|
||||
import com.fpghoti.biscuit.audio.request.RequestType;
|
||||
|
||||
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{
|
||||
|
||||
private boolean searchMode;
|
||||
|
||||
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) {
|
||||
|
||||
@@ -3,7 +3,8 @@ package com.fpghoti.biscuit.audio.request.youtube;
|
||||
import com.fpghoti.biscuit.audio.request.RequestType;
|
||||
|
||||
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{
|
||||
|
||||
|
||||
@@ -3,14 +3,14 @@ package com.fpghoti.biscuit.audio.request.youtube;
|
||||
import com.fpghoti.biscuit.audio.request.RequestType;
|
||||
|
||||
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{
|
||||
|
||||
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) {
|
||||
|
||||
@@ -4,14 +4,15 @@ import com.fpghoti.biscuit.audio.request.PlayRequest;
|
||||
import com.fpghoti.biscuit.audio.request.RequestType;
|
||||
|
||||
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{
|
||||
|
||||
private boolean searchMode;
|
||||
|
||||
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) {
|
||||
|
||||
@@ -13,7 +13,7 @@ import com.fpghoti.biscuit.audio.AudioScheduler;
|
||||
import com.fpghoti.biscuit.config.BiscuitConfig;
|
||||
import com.fpghoti.biscuit.config.BiscuitProperties;
|
||||
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.timer.BiscuitTimer;
|
||||
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.Member;
|
||||
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;
|
||||
|
||||
|
||||
public class Biscuit {
|
||||
|
||||
public static Biscuit getBiscuit(Guild g) {
|
||||
@@ -77,7 +79,7 @@ public class Biscuit {
|
||||
|
||||
private boolean isMain;
|
||||
private JDA jda;
|
||||
private BiscuitLog logger;
|
||||
private BiscuitLogger logger;
|
||||
private Timer timer;
|
||||
private List<BiscuitTimer> timers;
|
||||
private File captchaDir;
|
||||
@@ -93,7 +95,7 @@ public class Biscuit {
|
||||
private CopyOnWriteArrayList<PreUser> users = new CopyOnWriteArrayList<PreUser>();
|
||||
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.guild = guild;
|
||||
this.logger = log;
|
||||
|
||||
@@ -17,10 +17,11 @@ import com.github.cage.Cage;
|
||||
|
||||
import net.dv8tion.jda.api.entities.Guild;
|
||||
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.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;
|
||||
|
||||
public class Captcha {
|
||||
@@ -102,10 +103,11 @@ public class Captcha {
|
||||
genToken();
|
||||
generateImage();
|
||||
File captcha = getImageFile();
|
||||
FileUpload capUpload = FileUpload.fromData(captcha);
|
||||
|
||||
respond("Respond with the exact text in this image.");
|
||||
channel.sendFile(captcha).submit();
|
||||
|
||||
//channel.sendFile(captcha).submit();
|
||||
channel.sendFiles(capUpload);
|
||||
}else {
|
||||
boolean disable = false;
|
||||
if(captchaUser.inTestMode()) {
|
||||
|
||||
@@ -8,9 +8,9 @@ import com.fpghoti.biscuit.util.PermUtil;
|
||||
import net.dv8tion.jda.api.JDA;
|
||||
import net.dv8tion.jda.api.entities.Guild;
|
||||
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.channel.concrete.TextChannel;
|
||||
import net.dv8tion.jda.api.entities.channel.middleman.MessageChannel;
|
||||
|
||||
public class HandleCaptcha {
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ public class CommandManager {
|
||||
|
||||
public static void commandReply(MessageReceivedEvent event, String msg) {
|
||||
if(event != null) {
|
||||
MessageText.send(event.getTextChannel(), msg);
|
||||
MessageText.send(event.getChannel().asTextChannel(), msg);
|
||||
}else {
|
||||
Main.getLogger().info(msg);
|
||||
}
|
||||
|
||||
@@ -6,7 +6,8 @@ import com.fpghoti.biscuit.commands.base.ConsoleCommand;
|
||||
import com.fpghoti.biscuit.rest.MessageText;
|
||||
|
||||
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{
|
||||
|
||||
|
||||
@@ -6,7 +6,8 @@ import com.fpghoti.biscuit.commands.base.ConsoleCommand;
|
||||
import com.fpghoti.biscuit.rest.MessageText;
|
||||
|
||||
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{
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.fpghoti.biscuit.commands.base.ClientCommand;
|
||||
import com.fpghoti.biscuit.rest.MessageText;
|
||||
import com.fpghoti.biscuit.util.Util;
|
||||
|
||||
import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
|
||||
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
|
||||
|
||||
public class AddCommand extends ClientCommand{
|
||||
@@ -31,7 +32,7 @@ public class AddCommand extends ClientCommand{
|
||||
if(end.equals(".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 + "**.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ public class ChanIDCommand extends ClientCommand{
|
||||
Biscuit b = Biscuit.getBiscuit(event.getGuild());
|
||||
b.log(event.getAuthor().getName() + " issued a command: -chanid");
|
||||
String id = event.getChannel().getId();
|
||||
MessageText.send(event.getTextChannel(), id);
|
||||
MessageText.send(event.getChannel().asTextChannel(), id);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ public class DivideCommand extends ClientCommand{
|
||||
if(end.equals(".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 + "**.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.fpghoti.biscuit.commands.discord;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import com.fpghoti.biscuit.Main;
|
||||
import com.fpghoti.biscuit.biscuit.Biscuit;
|
||||
import com.fpghoti.biscuit.commands.base.ClientCommand;
|
||||
@@ -8,6 +10,7 @@ import com.fpghoti.biscuit.rest.MessageText;
|
||||
import com.fpghoti.biscuit.util.PermUtil;
|
||||
|
||||
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
|
||||
import net.dv8tion.jda.api.utils.FileUpload;
|
||||
|
||||
public class GetConfigCommand extends ClientCommand{
|
||||
|
||||
@@ -25,10 +28,14 @@ public class GetConfigCommand extends ClientCommand{
|
||||
Biscuit b = Biscuit.getBiscuit(event.getGuild());
|
||||
b.log(event.getAuthor().getName() + " issued a command: -getconfig");
|
||||
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 {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ public class GuildIDCommand extends ClientCommand{
|
||||
Biscuit b = Biscuit.getBiscuit(event.getGuild());
|
||||
b.log(event.getAuthor().getName() + " issued a command: -guildid");
|
||||
if(PermUtil.isMod(event.getMember())) {
|
||||
MessageText.send(event.getTextChannel(), event.getGuild().getId());
|
||||
MessageText.send(event.getChannel().asTextChannel(), event.getGuild().getId());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ public class HelpCommand extends ClientCommand {
|
||||
if(Util.isDigit(args[0])) {
|
||||
pg = Integer.parseInt(args[0]);
|
||||
}else {
|
||||
MessageText.send(event.getTextChannel(), "Usage: ``" + usage + "``");
|
||||
MessageText.send(event.getChannel().asTextChannel(), "Usage: ``" + usage + "``");
|
||||
}
|
||||
}
|
||||
List<BaseCommand> commands = new ArrayList<BaseCommand>();
|
||||
@@ -66,8 +66,8 @@ public class HelpCommand extends ClientCommand {
|
||||
pg = pageCount;
|
||||
}
|
||||
|
||||
MessageText.send(event.getTextChannel(), "**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(), "**Use " + Main.getMainBiscuit().getProperties().getCommandSignifier() + "help [Page #] to navigate the different pages.**");
|
||||
MessageText.send(event.getChannel().asTextChannel(), "[" + Integer.toString(pg) + "/" + Integer.toString(pageCount) + "] **Bot Commands:**");
|
||||
String msg = "";
|
||||
for (int i = 0; i < 8; i++) {
|
||||
int index = (pg - 1) * 8 + i;
|
||||
@@ -82,7 +82,7 @@ public class HelpCommand extends ClientCommand {
|
||||
msg = msg + line;
|
||||
}
|
||||
}
|
||||
MessageText.send(event.getTextChannel(), msg);
|
||||
MessageText.send(event.getChannel().asTextChannel(), msg);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,7 +8,8 @@ import com.fpghoti.biscuit.util.PermUtil;
|
||||
import com.fpghoti.biscuit.util.Util;
|
||||
|
||||
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;
|
||||
|
||||
public class MakeInviteCommand extends ClientCommand{
|
||||
@@ -40,7 +41,7 @@ public class MakeInviteCommand extends ClientCommand{
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
final double db = doubAge;
|
||||
@@ -50,7 +51,7 @@ public class MakeInviteCommand extends ClientCommand{
|
||||
if(db > 0) {
|
||||
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 + "**.");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ public class MultiplyCommand extends ClientCommand{
|
||||
if(end.equals(".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 + "**.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,12 +25,12 @@ public class NotSpammerCommand extends ClientCommand{
|
||||
public void execute(String[] args, MessageReceivedEvent event) {
|
||||
Biscuit b = Biscuit.getBiscuit(event.getGuild());
|
||||
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();
|
||||
String s = u.getAsMention();
|
||||
if(event.getChannel().getName().equals("public-spam-test") || (PermUtil.isMod(event.getMember()))) {
|
||||
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.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ public class PingCommand extends ClientCommand{
|
||||
public void execute(String[] args, MessageReceivedEvent event) {
|
||||
Biscuit b = Biscuit.getBiscuit(event.getGuild());
|
||||
b.log(event.getAuthor().getName() + " issued a command: -ping");
|
||||
MessageText.send(event.getTextChannel(), "Pong!");
|
||||
MessageText.send(event.getChannel().asTextChannel(), "Pong!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ public class PowerCommand extends ClientCommand{
|
||||
if(end.equals(".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 + "**.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ public class RecentSpammersCommand extends ClientCommand{
|
||||
Biscuit b = Biscuit.getBiscuit(event.getGuild());
|
||||
b.log(event.getAuthor().getName() + " issued a command: -recentspammers");
|
||||
String msg = b.getMessageStore().getSpammerList();
|
||||
MessageText.send(event.getTextChannel(), msg);
|
||||
MessageText.send(event.getChannel().asTextChannel(), msg);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -32,21 +32,21 @@ public class SaveConfigCommand extends ClientCommand{
|
||||
if(!attch.isEmpty()) {
|
||||
if(attch.size() == 1) {
|
||||
for(Attachment a : attch) {
|
||||
b.getConfig().replaceConfig(a, event.getTextChannel());
|
||||
b.getConfig().replaceConfig(a, event.getChannel().asTextChannel());
|
||||
b.remove();
|
||||
b = Biscuit.loadGuild(event.getGuild());
|
||||
}
|
||||
}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);
|
||||
}
|
||||
}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);
|
||||
}
|
||||
}else {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,17 +25,17 @@ public class SoftMuteCommand extends ClientCommand{
|
||||
public void execute(String[] args, MessageReceivedEvent event) {
|
||||
Biscuit b = Biscuit.getBiscuit(event.getGuild());
|
||||
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();
|
||||
String s = u.getAsMention();
|
||||
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;
|
||||
}
|
||||
if(event.getChannel().getName().equals("public-softmute-test") || (PermUtil.isMod(event.getMember()))) {
|
||||
b.getMessageStore().addSoftmuted(u);
|
||||
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.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ public class SquareRootCommand extends ClientCommand{
|
||||
if(end.equals(".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 + "**.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ public class SubtractCommand extends ClientCommand{
|
||||
if(end.equals(".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 + "**.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,8 +6,9 @@ import com.fpghoti.biscuit.commands.base.ClientCommand;
|
||||
import com.fpghoti.biscuit.rest.MessageText;
|
||||
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.emoji.Emoji;
|
||||
import net.dv8tion.jda.api.entities.emoji.EmojiUnion;
|
||||
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
|
||||
|
||||
public class ToggleRoleCommand extends ClientCommand{
|
||||
@@ -38,7 +39,7 @@ public class ToggleRoleCommand extends ClientCommand{
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -53,8 +54,8 @@ public class ToggleRoleCommand extends ClientCommand{
|
||||
return;
|
||||
}
|
||||
|
||||
Emote done = null;
|
||||
for(Emote e : event.getGuild().getEmotes()) {
|
||||
Emoji done = null;
|
||||
for(Emoji e : event.getMessage().getMentions().getCustomEmojis()) {
|
||||
if(e.getName().contains(b.getProperties().getDoneEmote())) {
|
||||
done = e;
|
||||
}
|
||||
@@ -80,7 +81,8 @@ public class ToggleRoleCommand extends ClientCommand{
|
||||
if(foundEmote) {
|
||||
event.getMessage().addReaction(done).queue();
|
||||
}else {
|
||||
event.getMessage().addReaction("✔").queue();
|
||||
//event.getMessage().addReaction("✔").queue();
|
||||
event.getMessage().addReaction(Emoji.fromFormatted("U+2714")).queue();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,10 +25,10 @@ public class UIDCommand extends ClientCommand{
|
||||
public void execute(String[] args, MessageReceivedEvent event) {
|
||||
Biscuit b = Biscuit.getBiscuit(event.getGuild());
|
||||
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();
|
||||
if(PermUtil.isMod(event.getMember())) {
|
||||
MessageText.send(event.getTextChannel(), u.getId());
|
||||
MessageText.send(event.getChannel().asTextChannel(), u.getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,12 +25,12 @@ public class UnSoftMuteCommand extends ClientCommand{
|
||||
public void execute(String[] args, MessageReceivedEvent event) {
|
||||
Biscuit b = Biscuit.getBiscuit(event.getGuild());
|
||||
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();
|
||||
String s = u.getAsMention();
|
||||
if(event.getChannel().getName().equals("public-softmute-test") || (PermUtil.isMod(event.getMember()))) {
|
||||
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.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ public class WikiCommand extends ClientCommand{
|
||||
Biscuit b = Biscuit.getBiscuit(event.getGuild());
|
||||
b.log(event.getAuthor().getName() + " issued a command: -wiki");
|
||||
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");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ public class ClearCommand extends MusicClientCommand{
|
||||
Biscuit b = Biscuit.getBiscuit(event.getGuild());
|
||||
b.log(event.getAuthor().getName() + " issued a command: -clear");
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,8 +26,8 @@ public class ClearUserSongsCommand extends MusicClientCommand{
|
||||
Biscuit b = Biscuit.getBiscuit(event.getGuild());
|
||||
b.log(event.getAuthor().getName() + " issued a command: -clearusersongs " + args[0]);
|
||||
if(PermUtil.hasMusicControl(event.getMember())) {
|
||||
for(Member m : event.getMessage().getMentionedMembers()) {
|
||||
MessageText.send(event.getTextChannel(), "Clearing all upcoming tracks added by **" + m.getEffectiveName() + "**.");
|
||||
for(Member m : event.getMessage().getMentions().getMembers()) {
|
||||
MessageText.send(event.getChannel().asTextChannel(), "Clearing all upcoming tracks added by **" + m.getEffectiveName() + "**.");
|
||||
b.getAudioScheduler().getQueue().removeUserTracks(m.getId());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,8 +24,8 @@ public class ForceSkipCommand extends MusicClientCommand{
|
||||
Biscuit b = Biscuit.getBiscuit(event.getGuild());
|
||||
b.log(event.getAuthor().getName() + " issued a command: -forceskip");
|
||||
if(PermUtil.hasMusicControl(event.getMember())) {
|
||||
MessageText.send(event.getTextChannel(), "Force skipping current song.");
|
||||
b.getAudioScheduler().skip(event.getTextChannel());
|
||||
MessageText.send(event.getChannel().asTextChannel(), "Force skipping current song.");
|
||||
b.getAudioScheduler().skip(event.getChannel().asTextChannel());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -28,9 +28,9 @@ public class ForceSkipToCommand extends MusicClientCommand{
|
||||
if(PermUtil.hasMusicControl(event.getMember())) {
|
||||
if(Util.isDigit(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().skip(event.getTextChannel());
|
||||
b.getAudioScheduler().skip(event.getChannel().asTextChannel());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,10 +25,10 @@ public class LoopMusicCommand extends MusicClientCommand{
|
||||
b.log(event.getAuthor().getName() + " issued a command: -loopmusic");
|
||||
if(PermUtil.hasMusicControl(event.getMember())) {
|
||||
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);
|
||||
}else {
|
||||
MessageText.send(event.getTextChannel(), "Disabling music looping.");
|
||||
MessageText.send(event.getChannel().asTextChannel(), "Disabling music looping.");
|
||||
b.getAudioScheduler().setLooping(false);
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ public class MoveToCommand extends MusicClientCommand{
|
||||
if(Util.isDigit(args[0]) && Util.isDigit(args[1])) {
|
||||
int oldPlace = Integer.parseInt(args[0]);
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,9 +25,9 @@ public class NowPlayingCommand extends MusicClientCommand{
|
||||
b.log(event.getAuthor().getName() + " issued a command: -nowplaying");
|
||||
if(b.getAudioScheduler().getQueue().getLastTrack() != null ) {
|
||||
MessageEmbed next = b.getAudioScheduler().getQueue().getLastTrack().getEmbedMessage("Now Playing:", true);
|
||||
MessageText.send(event.getTextChannel(), next);
|
||||
MessageText.send(event.getChannel().asTextChannel(), next);
|
||||
}else {
|
||||
MessageText.send(event.getTextChannel(), "No song is currently playing.");
|
||||
MessageText.send(event.getChannel().asTextChannel(), "No song is currently playing.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,9 +26,9 @@ public class PauseCommand extends MusicClientCommand{
|
||||
if(PermUtil.hasMusicControl(event.getMember())) {
|
||||
if(!b.getAudioPlayer().isPaused()) {
|
||||
b.getAudioPlayer().setPaused(true);
|
||||
MessageText.send(event.getTextChannel(), "Paused the current track.");
|
||||
MessageText.send(event.getChannel().asTextChannel(), "Paused the current track.");
|
||||
}else {
|
||||
MessageText.send(event.getTextChannel(), "The music player is already paused.");
|
||||
MessageText.send(event.getChannel().asTextChannel(), "The music player is already paused.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,8 @@ import com.fpghoti.biscuit.rest.MessageText;
|
||||
import com.fpghoti.biscuit.util.PermUtil;
|
||||
|
||||
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;
|
||||
|
||||
public class PlayFirstCommand extends MusicClientCommand{
|
||||
@@ -33,7 +34,7 @@ public class PlayFirstCommand extends MusicClientCommand{
|
||||
public void execute(String[] args, MessageReceivedEvent event) {
|
||||
Guild guild = event.getGuild();
|
||||
Biscuit b = Biscuit.getBiscuit(guild);
|
||||
TextChannel tchannel = event.getTextChannel();
|
||||
TextChannel tchannel = event.getChannel().asTextChannel();
|
||||
|
||||
int searchArg = 0;
|
||||
boolean scSearch = false;
|
||||
|
||||
@@ -33,7 +33,7 @@ public class QueueCommand extends MusicClientCommand{
|
||||
if(Util.isDigit(args[0])) {
|
||||
pg = Integer.parseInt(args[0]);
|
||||
}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(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 {
|
||||
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;
|
||||
}
|
||||
|
||||
MessageText.send(event.getTextChannel(), "**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(), "**Use " + Main.getMainBiscuit().getProperties().getCommandSignifier() + "queue [Page #] to navigate the different pages.**");
|
||||
MessageText.send(event.getChannel().asTextChannel(), "[" + Integer.toString(pg) + "/" + Integer.toString(pageCount) + "] ** Upcoming Music Tracks:**");
|
||||
String msg = "";
|
||||
for (int i = 0; i < 8; i++) {
|
||||
int index = (pg - 1) * 8 + i;
|
||||
@@ -76,7 +76,7 @@ public class QueueCommand extends MusicClientCommand{
|
||||
msg = msg + line;
|
||||
}
|
||||
}
|
||||
MessageText.send(event.getTextChannel(), msg);
|
||||
MessageText.send(event.getChannel().asTextChannel(), msg);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ public class RemoveCommand extends MusicClientCommand{
|
||||
if(PermUtil.hasMusicControl(event.getMember())) {
|
||||
if(Util.isDigit(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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,9 +24,9 @@ public class ShuffleCommand extends MusicClientCommand{
|
||||
b.log(event.getAuthor().getName() + " issued a command: -shuffle");
|
||||
if(b.getAudioScheduler().getQueue().getLastTrack() != null ) {
|
||||
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 {
|
||||
MessageText.send(event.getTextChannel(), "No song is currently playing.");
|
||||
MessageText.send(event.getChannel().asTextChannel(), "No song is currently playing.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,9 +24,9 @@ public class SkipAllCommand extends MusicClientCommand{
|
||||
Biscuit b = Biscuit.getBiscuit(event.getGuild());
|
||||
b.log(event.getAuthor().getName() + " issued a command: -skipall");
|
||||
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().skip(event.getTextChannel());
|
||||
b.getAudioScheduler().skip(event.getChannel().asTextChannel());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,10 +8,10 @@ import com.fpghoti.biscuit.biscuit.Biscuit;
|
||||
import com.fpghoti.biscuit.commands.base.MusicClientCommand;
|
||||
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.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;
|
||||
|
||||
public class SkipCommand extends MusicClientCommand{
|
||||
@@ -32,11 +32,11 @@ public class SkipCommand extends MusicClientCommand{
|
||||
Biscuit biscuit = Biscuit.getBiscuit(guild);
|
||||
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.
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
@@ -27,10 +27,10 @@ public class TogglePauseCommand extends MusicClientCommand{
|
||||
if(PermUtil.hasMusicControl(event.getMember())) {
|
||||
if(b.getAudioPlayer().isPaused()) {
|
||||
b.getAudioPlayer().setPaused(false);
|
||||
MessageText.send(event.getTextChannel(), "Unpaused the current track.");
|
||||
MessageText.send(event.getChannel().asTextChannel(), "Unpaused the current track.");
|
||||
}else {
|
||||
b.getAudioPlayer().setPaused(true);
|
||||
MessageText.send(event.getTextChannel(), "Paused the current track.");
|
||||
MessageText.send(event.getChannel().asTextChannel(), "Paused the current track.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,9 +27,9 @@ public class UnpauseCommand extends MusicClientCommand{
|
||||
if(PermUtil.hasMusicControl(event.getMember())) {
|
||||
if(b.getAudioPlayer().isPaused()) {
|
||||
b.getAudioPlayer().setPaused(false);
|
||||
MessageText.send(event.getTextChannel(), "Unpaused the current track.");
|
||||
MessageText.send(event.getChannel().asTextChannel(), "Unpaused the current track.");
|
||||
}else {
|
||||
MessageText.send(event.getTextChannel(), "The music player is not paused.");
|
||||
MessageText.send(event.getChannel().asTextChannel(), "The music player is not paused.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ public class VolumeCommand extends MusicClientCommand{
|
||||
|
||||
if(args.length < 1) {
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ public class VolumeCommand extends MusicClientCommand{
|
||||
vol = 150;
|
||||
}
|
||||
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() + "**.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ import com.jcabi.aspects.Async;
|
||||
|
||||
import net.dv8tion.jda.api.entities.Guild;
|
||||
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 {
|
||||
|
||||
@@ -74,7 +74,7 @@ public class BiscuitConfig {
|
||||
return;
|
||||
}
|
||||
File config = new File(biscuit.getConfigDir(), name);
|
||||
a.downloadToFile(config).thenAccept(file -> {
|
||||
a.getProxy().downloadToFile(config).thenAccept(file -> {
|
||||
updateConfig(file, true, code);
|
||||
MessageText.send(c, "**The config was successfully updated.**");
|
||||
}).exceptionally(t -> {
|
||||
@@ -82,6 +82,7 @@ public class BiscuitConfig {
|
||||
MessageText.send(c, "**An Exception occurred while trying to read the file.**");
|
||||
return null;
|
||||
});
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -135,6 +136,7 @@ public class BiscuitConfig {
|
||||
added = addProperty("Bot-Token", "", prop, added, silent);
|
||||
added = addProperty("Enable-Music-Bot", "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);
|
||||
|
||||
@@ -32,6 +32,11 @@ public class BiscuitProperties {
|
||||
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(){
|
||||
if(!musicBotEnabled()) {
|
||||
return false;
|
||||
|
||||
@@ -4,19 +4,19 @@ import java.util.Scanner;
|
||||
|
||||
import com.fpghoti.biscuit.biscuit.Biscuit;
|
||||
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 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.hooks.ListenerAdapter;
|
||||
|
||||
public class CommandListener extends ListenerAdapter implements Runnable {
|
||||
|
||||
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.log = log;
|
||||
}
|
||||
@@ -27,7 +27,7 @@ public class CommandListener extends ListenerAdapter implements Runnable {
|
||||
return;
|
||||
}
|
||||
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()){
|
||||
CommandManager.parse(event.getMessage().getContentRaw().toLowerCase(), event);
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import com.fpghoti.biscuit.Main;
|
||||
import com.fpghoti.biscuit.captcha.HandleCaptcha;
|
||||
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.hooks.ListenerAdapter;
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ public class MessageDeleteListener extends ListenerAdapter {
|
||||
@Override
|
||||
public void onMessageDelete(MessageDeleteEvent event) {
|
||||
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.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ public class MessageEditListener extends ListenerAdapter {
|
||||
@Override
|
||||
public void onMessageUpdate(MessageUpdateEvent event) {
|
||||
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 +
|
||||
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());
|
||||
|
||||
@@ -42,14 +42,14 @@ public class MessageReceiveListener extends ListenerAdapter{
|
||||
}
|
||||
|
||||
//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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void logBot(MessageReceivedEvent event, Biscuit biscuit) {
|
||||
if(Util.isLoggable(event.getTextChannel())) {
|
||||
if(Util.isLoggable(event.getChannel().asTextChannel())) {
|
||||
if(biscuit.getProperties().logChat()) {
|
||||
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());
|
||||
@@ -58,7 +58,7 @@ public class MessageReceiveListener extends ListenerAdapter{
|
||||
}
|
||||
|
||||
private void logUser(MessageReceivedEvent event, Biscuit biscuit) {
|
||||
if(Util.isLoggable(event.getTextChannel())) {
|
||||
if(Util.isLoggable(event.getChannel().asTextChannel())) {
|
||||
if(biscuit.getProperties().logChat()) {
|
||||
biscuit.log("[" + BColor.CYAN_BOLD + "MSG" + BColor.RESET + "] " + BColor.GREEN + "ID: " + BColor.RESET +
|
||||
event.getMessageId() + BColor.GREEN + " Sender: " + BColor.RESET + event.getAuthor().getAsMention());
|
||||
@@ -83,7 +83,7 @@ public class MessageReceiveListener extends ListenerAdapter{
|
||||
private boolean isNaughty(MessageReceivedEvent event) {
|
||||
// TODO make staff filter configurable
|
||||
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();
|
||||
return true;
|
||||
}
|
||||
@@ -151,14 +151,14 @@ public class MessageReceiveListener extends ListenerAdapter{
|
||||
store.addSpammer(event.getAuthor());
|
||||
store.removeSpamWarned(event.getAuthor());
|
||||
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!");
|
||||
event.getMessage().delete().reason("Spam removal activated for " + mention).submit();
|
||||
//User is spamming and has not been warned. Apply warning.
|
||||
}else if(!store.isSpammer(event.getAuthor()) && !store.isSpamWarned(event.getAuthor())){
|
||||
store.removeMessageCount(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!");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ public class ReactionListener extends ListenerAdapter{
|
||||
if(event.getGuild() == null) {
|
||||
return;
|
||||
}
|
||||
if(Util.contains(biscuit.getProperties().getToggleChannels(),event.getTextChannel().getName())) {
|
||||
if(Util.contains(biscuit.getProperties().getToggleChannels(),event.getChannel().asTextChannel().getName())) {
|
||||
handleMessageRole(event, false);
|
||||
}
|
||||
}
|
||||
@@ -32,14 +32,14 @@ public class ReactionListener extends ListenerAdapter{
|
||||
if(event.getGuild() == null) {
|
||||
return;
|
||||
}
|
||||
if(Util.contains(biscuit.getProperties().getToggleChannels(),event.getTextChannel().getName())) {
|
||||
if(Util.contains(biscuit.getProperties().getToggleChannels(),event.getChannel().asTextChannel().getName())) {
|
||||
handleMessageRole(event, true);
|
||||
}
|
||||
}
|
||||
|
||||
private void handleMessageRole(GenericMessageReactionEvent event, boolean remove) {
|
||||
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();
|
||||
for(String rolename : biscuit.getProperties().getToggleRoles()) {
|
||||
for(Role r : event.getGuild().getRoles()) {
|
||||
@@ -65,7 +65,7 @@ public class ReactionListener extends ListenerAdapter{
|
||||
Member m = event.getMember();
|
||||
if(remove) {
|
||||
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();
|
||||
}
|
||||
}else {
|
||||
@@ -80,7 +80,7 @@ public class ReactionListener extends ListenerAdapter{
|
||||
canAdd = true;
|
||||
}
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
58
src/main/java/com/fpghoti/biscuit/logging/BiscuitLogger.java
Normal file
58
src/main/java/com/fpghoti/biscuit/logging/BiscuitLogger.java
Normal 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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -7,7 +7,7 @@ import org.pf4j.PluginWrapper;
|
||||
|
||||
import com.fpghoti.biscuit.Main;
|
||||
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.sedmelluq.discord.lavaplayer.player.AudioPlayerManager;
|
||||
|
||||
@@ -59,7 +59,7 @@ public abstract class BiscuitPlugin extends Plugin {
|
||||
return Main.getPlayerManager();
|
||||
}
|
||||
|
||||
public BiscuitLog getLogger() {
|
||||
public BiscuitLogger getLogger() {
|
||||
return Main.getLogger();
|
||||
}
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@ import com.fpghoti.biscuit.Main;
|
||||
import com.fpghoti.biscuit.biscuit.Biscuit;
|
||||
|
||||
import net.dv8tion.jda.api.entities.MessageEmbed;
|
||||
import net.dv8tion.jda.api.entities.PrivateChannel;
|
||||
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;;
|
||||
|
||||
public class MessageText {
|
||||
|
||||
|
||||
@@ -9,8 +9,8 @@ import com.fpghoti.biscuit.captcha.Captcha;
|
||||
|
||||
import net.dv8tion.jda.api.JDA;
|
||||
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.channel.middleman.MessageChannel;
|
||||
|
||||
public class CaptchaUser implements Iterable<PreUser>{
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import com.fpghoti.biscuit.biscuit.Biscuit;
|
||||
import com.fpghoti.biscuit.logging.BColor;
|
||||
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;
|
||||
|
||||
public class ChatFilter {
|
||||
@@ -36,7 +36,7 @@ public class ChatFilter {
|
||||
}
|
||||
|
||||
//Custom emote check
|
||||
for(Emote e : event.getMessage().getEmotes()) {
|
||||
for(Emoji e : event.getMessage().getMentions().getCustomEmojis()) {
|
||||
String name = e.getName();
|
||||
|
||||
for(String s : biscuit.getProperties().blockedCustomEmotes()) {
|
||||
|
||||
@@ -4,7 +4,7 @@ import java.util.Random;
|
||||
|
||||
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 static int randInt(int min, int max) {
|
||||
|
||||
Reference in New Issue
Block a user