DiscordBot.mainJDA=event.getJDA();// refresh it? //no need, everything's getJDA() is the same jda basis but audioplayer's still using it; need to migrate to store in guildmusicmanager
//String[] words = event.getMessage().getContentDisplay().split(" ");
//if(event.getGuild().getId().equals("398140934035996687")) channel.getGuild().getRolesByName("Actual robutt role, this one has perms don't fuck with it", true).get(0).getPermissions().forEach(p -> System.out.println(p));
Stringperms=cmd.hasSubCommand()?null:MiscUtils.getMissingPerms(perm,cmd.getRequiredBotUserLevel(),event.getMember(),channel);//pass it to the subcommand handler to handle instead
if(perms==null||event.getAuthor().getId().equals(DiscordBot.OwnerID)){//owner overrides perms for convenience
+msg.getContentDisplay()+(r.getRemarks()==null?".":". ("+r.getRemarks()+")"));//logging has to be before sendMessage, or else if no permission it will just quit
eb.setDescription("[This image]("+origPic+")"+(origPic.equals(pic)?"":"([source]("+pic+"))")+" is a repost of [this message]("+m.getJumpUrl()+") by `"+m.getAuthor().getName()+"#"+m.getAuthor().getDiscriminator()+"` at **"+m.getTimeCreated().format(DateTimeFormatter.RFC_1123_DATE_TIME)+"**.\n");
eb.setThumbnail(origPic);
channel.sendMessage(eb.build()).queue();
continue;
}catch(NullPointerExceptione){//if the message is deleted
eb.appendDescription("Total members (cached): `"+DiscordBot.mainJDA.getUserCache().size()+(DiscordBot.mainJDA.getShardManager()==null?"":"/"+DiscordBot.mainJDA.getShardManager().getShards().stream().mapToLong(jda->jda.getUserCache().size()).sum())+"`\n");
eb.appendDescription("DM `despawningbone#4078` if you have any questions!\n");
eb.appendDescription("To get a list of commands, do `"+prefix+"help`.");
DiscordBot.logger.trace("[EDIT] "+guildinfo+System.lineSeparator()+" "+msg+System.lineSeparator()+" Full edited msg: "+msg.getContentDisplay());
}
}
@Override
publicvoidonUserActivityStart(UserActivityStartEventevent){//store presence for checking osu pp
Activityosu=event.getNewActivity();
if(osu!=null&&osu.getName().equals("osu!")&&osu.isRich()//if need to include other games and details, just remove this if clause and change sGame below
long ms = Math.abs(timesent.until(timeReceived, ChronoUnit.MILLIS));
System.out.println("Time taken: " + ms + "ms");*/
try(Connectioncon=DiscordBot.db.getConnection()){//DONE do i need to close the statement?
PreparedStatements=con.prepareStatement("INSERT INTO users(id, game) VALUES ("+event.getUser().getId()+", ?) ON CONFLICT(id) DO UPDATE SET game = ? WHERE game <> ?;");//prevent blank updates
publicvoidonGuildVoiceLeave(GuildVoiceLeaveEventevent){// theoretically i dont need to check if lastMusicCmd has the entry or not, as it must have one to trigger this
publicvoidonGuildVoiceMove(GuildVoiceMoveEventevent){// theoretically i dont need to check if lastMusicCmd has the entry or not, as it must have one to trigger this