import java.util.*;
import java.util.zip.*;
import java.util.List;
import java.util.regex.*;
import java.util.concurrent.*;
import java.util.concurrent.atomic.*;
import java.util.concurrent.locks.*;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.text.*;
import javax.swing.table.*;
import java.io.*;
import java.net.*;
import java.lang.reflect.*;
import java.lang.ref.*;
import java.lang.management.*;
import java.security.*;
import java.security.spec.*;
import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;
import javax.imageio.*;
import java.math.*;
import x30_pkg.x30_util;
import static x30_pkg.x30_util.VF1;
import static x30_pkg.x30_util.l;
import static x30_pkg.x30_util.fail;
import static x30_pkg.x30_util.indexOf;
import static x30_pkg.x30_util.getOpt;
import static x30_pkg.x30_util.setOpt;
import static x30_pkg.x30_util.callOpt;
import static x30_pkg.x30_util.newWeakHashMap;
import static x30_pkg.x30_util.newDangerousWeakHashMap;
import static x30_pkg.x30_util.get;
import static x30_pkg.x30_util.get_raw;
import static x30_pkg.x30_util.assertTrue;
import static x30_pkg.x30_util.isHeadless;
import static x30_pkg.x30_util.isAndroid;
import static x30_pkg.x30_util.isTrue;
import static x30_pkg.x30_util.asList;
import x30_pkg.x30_util.DynamicObject;
import loadableUtils.utils;
import static loadableUtils.utils._threadInfo;
import static loadableUtils.utils._threadInheritInfo;
import static loadableUtils.utils._threadInfo_addMakerAndRetriever;
import static loadableUtils.utils.dm_currentModule;
import static loadableUtils.utils.dm_current_mandatory;
import static loadableUtils.utils.match;
import static loadableUtils.utils.getOpt_raw;
import static loadableUtils.utils.setOpt_raw;
import static loadableUtils.utils.getField;
import static loadableUtils.utils.fieldType;
import static loadableUtils.utils.format3;
import static loadableUtils.utils.vm_generalIdentityHashSet;
import static loadableUtils.utils.vm_generalHashMap;
import static loadableUtils.utils.vm_generalWeakSubMap;
import static loadableUtils.utils.bindToComponent;
import static loadableUtils.utils.struct;
import static loadableUtils.utils.structure;
import static loadableUtils.utils.loadPage;
import static loadableUtils.utils.loadPage_utf8;
import static loadableUtils.utils.loadPageSilentlyWithTimeout;
import static loadableUtils.utils.loadPageSilently;
import static loadableUtils.utils.loadSnippet;
import static loadableUtils.utils.loadSnippetQuietly;
import static loadableUtils.utils.sendToLocalBot;
import static loadableUtils.utils.componentPopupMenu;
import static loadableUtils.utils.componentPopupMenu_top;
import static loadableUtils.utils.componentPopupMenu_initForComponent;
import static loadableUtils.utils.componentPopupMenu_getEvent;
import static loadableUtils.utils.listPopupMenu;
import static loadableUtils.utils.tablePopupMenu;
import static loadableUtils.utils.rowSorter_setComparators;
import static loadableUtils.utils.sexyTableWithoutDrag;
import static loadableUtils.utils.dm_current_generic;
import static loadableUtils.utils.dm_current_mandatory_generic;
import static loadableUtils.utils.cset;
import static loadableUtils.utils.DynamicObject_loading;
import static loadableUtils.utils.concepts_unlisted;
import static loadableUtils.utils.makePopupMenuConditional;
import static loadableUtils.utils.makeConceptsTable_idWidth;
import static loadableUtils.utils.showConceptsTable_afterUpdate;
import static loadableUtils.utils.dynamicObjectIsLoading;
import loadableUtils.utils.F0;
import loadableUtils.utils.F1;
import loadableUtils.utils.IF1;
import loadableUtils.utils.Matches;
import loadableUtils.utils.BetterLabel;
import loadableUtils.utils.SingleComponentPanel;
import loadableUtils.utils.Snippet;
import loadableUtils.utils.Q;
import loadableUtils.utils.ImageSurface;
import loadableUtils.utils.structure_Data;
import loadableUtils.utils.RGBImage;
import loadableUtils.utils.RGB;
import loadableUtils.utils.BWImage;
import loadableUtils.utils.MakesBufferedImage;
import loadableUtils.utils.MultiSet;
import loadableUtils.utils.Concept;
import loadableUtils.utils.Concepts;
import loadableUtils.utils.IConceptIndex;
import loadableUtils.utils.IFieldIndex;
import loadableUtils.utils.Derefable;
import loadableUtils.utils.ImageSurfaceSelector;
import loadableUtils.utils.SimpleCRUD;
import loadableUtils.utils.PersistableThrowable;
import loadableUtils.utils.DynModule;
import loadableUtils.utils.DynPrintLog;
import loadableUtils.utils.DynObjectTable;
import loadableUtils.utils.DynImageSurface;
import loadableUtils.utils.DynCalculatedList;
import loadableUtils.utils.Rect;
import loadableUtils.utils.Pt;
import java.text.NumberFormat;
import javax.net.ssl.*;
import java.security.SecureRandom;
import java.security.cert.X509Certificate;
import java.text.SimpleDateFormat;
import net.dv8tion.jda.core.events.guild.member.*;
import net.dv8tion.jda.core.*;
import net.dv8tion.jda.core.entities.*;
import net.dv8tion.jda.core.entities.Member;
import net.dv8tion.jda.core.hooks.*;
import net.dv8tion.jda.core.events.message.*;
import net.dv8tion.jda.core.events.message.react.*;
import java.text.*;
import java.util.TimeZone;
import net.dv8tion.jda.core.managers.AudioManager;
import net.dv8tion.jda.core.audio.*;
import java.nio.ByteBuffer;
import com.sedmelluq.discord.lavaplayer.player.*;
import com.sedmelluq.discord.lavaplayer.player.event.*;
import com.sedmelluq.discord.lavaplayer.demo.jda.TrackScheduler;
import com.sedmelluq.discord.lavaplayer.track.*;
import com.sedmelluq.discord.lavaplayer.track.playback.*;
import com.sedmelluq.discord.lavaplayer.source.*;
import com.sedmelluq.discord.lavaplayer.tools.*;
class main {
public static AudioPlayerManager playerManager;
public static void cleanMeUp() {
{
cleanUp(playerManager);
playerManager = null;
}
}
public static class DiscordAudioSpike extends DynTalkBot2 {
public String myName = "Discord Audio Spike";
public void start() {
super.start();
setLoggingLevel(ch.qos.logback.classic.Level.DEBUG);
if (isLinux()) {
loadNativeLibrarySnippet("#1400293");
}
makeByServer = () -> new ByServer();
useAGIBlueForDropPunctuation = false;
preprocessAtSelfToMyName = false;
if (playerManager == null) {
playerManager = new DefaultAudioPlayerManager();
AudioSourceManagers.registerLocalSource(playerManager);
AudioSourceManagers.registerRemoteSources(playerManager);
}
}
public class ByServer extends DynTalkBot2.ByServer {
public synchronized String processSimplifiedLine(String s, Object... __) {
{
String _a_13 = super.processSimplifiedLine(s, __);
if (!empty(_a_13))
return _a_13;
}
Matches m = new Matches();
if ((s = dropMyPrefixOrNull(s)) == null)
return null;
Message msg = (Message) (optPar("msg", __));
Guild guild = msg == null ? null : msg.getGuild();
if (match("voice channels", s))
return str(guild.getVoiceChannels());
if (match("join voice channel", s))
return joinVoiceChannel(first(guild.getVoiceChannels()));
if (eqic(s, "help"))
return ltrim("\r\nI'm a Discord Audio Test\r\n\r\n[Bot made by https://BotCompany.de]\r\n ").replace("@me", atSelf());
return null;
}
public String joinVoiceChannel(VoiceChannel vc) {
if (vc == null)
return "No channel";
Guild guild = vc.getGuild();
AudioManager am = guild.getAudioManager();
AudioPlayer player = playerManager.createPlayer();
TrackScheduler trackScheduler = new TrackScheduler(player);
player.addListener(trackScheduler);
player.addListener(e -> {
AutoCloseable __7 = enter();
try {
print("Audio event: " + e);
if (e instanceof TrackExceptionEvent)
printStackTrace(((TrackExceptionEvent) e).exception);
} finally {
_close(__7);
}
});
am.setSendingHandler(new AudioPlayerSendHandler(player));
am.openAudioConnection(vc);
String trackID = "http://s3.free-shoutcast.com:18162/;?type=http&nocache=" + randomInt();
playerManager.loadItem(print("Loading: ", trackID), new AudioLoadResultHandler() {
public void trackLoaded(AudioTrack track) {
AutoCloseable __8 = enter();
try {
print(player.startTrack(track, false));
print("Started track " + track);
print("isPaused: " + player.isPaused());
print("Active track: " + player.getPlayingTrack());
} finally {
_close(__8);
}
}
public void playlistLoaded(AudioPlaylist playlist) {
AutoCloseable __9 = enter();
try {
for (AudioTrack track : playlist.getTracks()) trackScheduler.queue(track);
} finally {
_close(__9);
}
}
public void noMatches() {
AutoCloseable __10 = enter();
try {
print("noMatches");
} finally {
_close(__10);
}
}
public void loadFailed(FriendlyException e) {
AutoCloseable __11 = enter();
try {
print("loadFailed: " + e);
printStackTrace(e);
} finally {
_close(__11);
}
}
});
return "Audio connection to " + vc.getName() + " opened";
}
}
}
public static boolean _moduleClass_DiscordAudioSpike = false;
public static class AudioPlayerSendHandler implements AudioSendHandler {
public AudioPlayer audioPlayer;
public AudioFrame lastFrame;
public NotTooOften nto = notTooOften_everySecond();
public AudioPlayerSendHandler(AudioPlayer audioPlayer) {
this.audioPlayer = audioPlayer;
}
public boolean canProvide() {
lastFrame = audioPlayer.provide();
if (nto.yo())
print("canProvide: " + (lastFrame != null));
return lastFrame != null;
}
public byte[] provide20MsAudio() {
return lastFrame.getData();
}
public boolean isOpus() {
return true;
}
}
public static void setLoggingLevel(ch.qos.logback.classic.Level level) {
ch.qos.logback.classic.Logger root = (ch.qos.logback.classic.Logger) org.slf4j.LoggerFactory.getLogger(ch.qos.logback.classic.Logger.ROOT_LOGGER_NAME);
root.setLevel(level);
}
public static Object callF(Object f, Object... args) {
try {
if (f instanceof String)
return callMC((String) f, args);
return x30_util.callF(f, args);
} catch (Exception __e) {
throw rethrow(__e);
}
}
public static A callF(F0 f) {
return f == null ? null : f.get();
}
public static A callF(IF0 f) {
return f == null ? null : f.get();
}
public static B callF(F1 f, A a) {
return f == null ? null : f.get(a);
}
public static B callF(IF1 f, A a) {
return f == null ? null : f.get(a);
}
public static C callF(F2 f, A a, B b) {
return f == null ? null : f.get(a, b);
}
public static void callF(VF1 f, A a) {
if (f != null)
f.get(a);
}
public static Object callMC(String method, Object... args) {
return call(mc(), method, args);
}
public static Object call(Object o) {
return callF(o);
}
public static Object call(Object o, String method, Object... args) {
return call_withVarargs(o, method, args);
}
public static void _onLoad_initUtils() {
utils.__javax = javax();
}
public static void _onLoad_defaultClassFinder() {
setDefaultClassFinder(new F1() {
public Class get(String name) {
try {
Class c = findClass_fullName(name);
if (c != null)
return c;
if (startsWith(name, "main$"))
return loadableUtils.utils.findClass_fullName("loadableUtils.utils" + substring(name, 4));
return null;
} catch (Exception __e) {
throw rethrow(__e);
}
}
public String toString() {
return "Class c = findClass_fullName(name);\r\n if (c != null) ret c;\r\n if (start...";
}
});
}
public static String programID() {
return getProgramID();
}
public static String programID(Object o) {
return getProgramID(o);
}
public static volatile StringBuffer local_log = new StringBuffer();
public static volatile Appendable print_log = local_log;
public static volatile int print_log_max = 1024 * 1024;
public static volatile int local_log_max = 100 * 1024;
public static boolean print_silent = false;
public static Object print_byThread_lock = new Object();
public static volatile ThreadLocal