Updated dependencies.
This is a massive commit incorporating 5 years' worth of upstream dependencies updates all at once, particularly with JDA. Several classpaths and APIs changed, requiring some rework. The bot is mostly functional as a result, but issues remain with reaction callbacks and playing audio from YouTube.
This commit is contained in:
31
build.gradle
31
build.gradle
@@ -1,27 +1,38 @@
|
||||
buildscript {
|
||||
repositories {
|
||||
jcenter()
|
||||
gradlePluginPortal()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath 'com.github.jengelman.gradle.plugins:shadow:4.0.4'
|
||||
classpath 'com.github.johnrengelman:shadow:8.1.1'
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'com.github.johnrengelman.shadow'
|
||||
apply plugin: 'java'
|
||||
|
||||
repositories {
|
||||
jcenter()
|
||||
mavenCentral()
|
||||
|
||||
maven {
|
||||
name 'm2-dv8tion'
|
||||
url 'https://m2.dv8tion.net/releases'
|
||||
}
|
||||
|
||||
maven {
|
||||
url 'https://m2.dv8tion.net/releases'
|
||||
}
|
||||
|
||||
maven {
|
||||
url 'https://jitpack.io'
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'org.slf4j:slf4j-simple:1.7.26'
|
||||
implementation 'org.slf4j:slf4j-simple:2.0.13'
|
||||
|
||||
implementation 'net.dv8tion:JDA:3.8.3_463'
|
||||
implementation 'com.sedmelluq:lavaplayer:1.3.17'
|
||||
implementation 'redis.clients:jedis:3.0.1'
|
||||
implementation 'com.vdurmont:emoji-java:4.0.0'
|
||||
implementation 'net.dv8tion:JDA:5.0.0-beta.24'
|
||||
implementation 'dev.arbjerg:lavaplayer:2.1.1'
|
||||
implementation 'redis.clients:jedis:5.1.3'
|
||||
}
|
||||
|
||||
jar {
|
||||
|
||||
5
gradle/wrapper/gradle-wrapper.properties
vendored
5
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,5 +1,6 @@
|
||||
#Wed May 29 18:53:59 EDT 2024
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4.1-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
@@ -1,35 +1,32 @@
|
||||
package dev.logal.logalbot;
|
||||
|
||||
// Copyright 2019 Logan Fick
|
||||
/*
|
||||
* Copyright 2022 Logan Fick
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import javax.security.auth.login.LoginException;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import dev.logal.logalbot.commands.administration.*;
|
||||
import dev.logal.logalbot.commands.administration.Settings;
|
||||
import dev.logal.logalbot.commands.administration.Whitelist;
|
||||
import dev.logal.logalbot.commands.audio.*;
|
||||
import dev.logal.logalbot.commands.fun.*;
|
||||
import dev.logal.logalbot.commands.general.*;
|
||||
import dev.logal.logalbot.commands.fun.Dice;
|
||||
import dev.logal.logalbot.commands.fun.EightBall;
|
||||
import dev.logal.logalbot.commands.general.About;
|
||||
import dev.logal.logalbot.commands.general.Help;
|
||||
import dev.logal.logalbot.events.*;
|
||||
import dev.logal.logalbot.utils.AudioUtil;
|
||||
import dev.logal.logalbot.utils.CommandManager;
|
||||
import dev.logal.logalbot.utils.DataManager;
|
||||
import net.dv8tion.jda.core.AccountType;
|
||||
import net.dv8tion.jda.core.JDA;
|
||||
import net.dv8tion.jda.core.JDABuilder;
|
||||
import net.dv8tion.jda.api.JDA;
|
||||
import net.dv8tion.jda.api.JDABuilder;
|
||||
import net.dv8tion.jda.api.requests.GatewayIntent;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
|
||||
public final class Main implements Runnable {
|
||||
private static final Logger logger = LoggerFactory.getLogger(Main.class);
|
||||
@@ -67,15 +64,13 @@ public final class Main implements Runnable {
|
||||
|
||||
logger.info("Attempting to log into Discord...");
|
||||
try {
|
||||
final JDABuilder builder = new JDABuilder(AccountType.BOT);
|
||||
final JDABuilder builder = JDABuilder.createDefault(token);
|
||||
builder.enableIntents(GatewayIntent.GUILD_VOICE_STATES);
|
||||
builder.enableIntents(GatewayIntent.MESSAGE_CONTENT);
|
||||
builder.setAutoReconnect(true);
|
||||
builder.setAudioEnabled(true);
|
||||
builder.setToken(token);
|
||||
builder.addEventListener(new GuildReady());
|
||||
builder.addEventListeners(new GuildReady());
|
||||
jda = builder.build().awaitReady();
|
||||
} catch (final LoginException exception) {
|
||||
logger.error("The token specified is not valid.");
|
||||
System.exit(1);
|
||||
} catch (final Throwable exception) {
|
||||
logger.error("An error occurred while attempting to set up JDA!", exception);
|
||||
System.exit(1);
|
||||
@@ -85,9 +80,8 @@ public final class Main implements Runnable {
|
||||
logger.info("Initializing...");
|
||||
AudioUtil.initializePlayerManager();
|
||||
|
||||
jda.addEventListener(new GuildVoiceLeave());
|
||||
jda.addEventListener(new GuildVoiceMove());
|
||||
jda.addEventListener(new GuildMessageReactionAdd());
|
||||
jda.addEventListener(new GuildVoiceUpdate());
|
||||
jda.addEventListener(new MessageReactionAdd());
|
||||
|
||||
// General Commands
|
||||
CommandManager.registerCommand("about", new About(), false);
|
||||
@@ -145,7 +139,7 @@ public final class Main implements Runnable {
|
||||
CommandManager.registerCommandAlias("conf", "settings");
|
||||
|
||||
logger.info("Everything seems to be ready! Enabling command listener...");
|
||||
jda.addEventListener(new GuildMessageReceived());
|
||||
jda.addEventListener(new MessageReceived());
|
||||
logger.info("Initialization complete!");
|
||||
}
|
||||
}
|
||||
@@ -1,26 +1,20 @@
|
||||
package dev.logal.logalbot;
|
||||
|
||||
// Copyright 2019 Logan Fick
|
||||
/*
|
||||
* Copyright 2022 Logan Fick
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
import net.dv8tion.jda.internal.utils.Checks;
|
||||
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import net.dv8tion.jda.core.utils.Checks;
|
||||
|
||||
public final class MainThread {
|
||||
private static final ScheduledExecutorService mainThread = Executors
|
||||
.newSingleThreadScheduledExecutor(new MainThreadFactory());
|
||||
|
||||
@@ -1,23 +1,17 @@
|
||||
package dev.logal.logalbot;
|
||||
|
||||
// Copyright 2019 Logan Fick
|
||||
/*
|
||||
* Copyright 2022 Logan Fick
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
import net.dv8tion.jda.internal.utils.Checks;
|
||||
|
||||
import java.util.concurrent.ThreadFactory;
|
||||
|
||||
import net.dv8tion.jda.core.utils.Checks;
|
||||
|
||||
public final class MainThreadFactory implements ThreadFactory {
|
||||
@Override
|
||||
public final Thread newThread(final Runnable runnable) {
|
||||
|
||||
@@ -1,24 +1,19 @@
|
||||
package dev.logal.logalbot.audio;
|
||||
|
||||
// Copyright 2019 Logan Fick
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
/*
|
||||
* Copyright 2022 Logan Fick
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
import com.sedmelluq.discord.lavaplayer.player.AudioPlayer;
|
||||
import com.sedmelluq.discord.lavaplayer.track.playback.AudioFrame;
|
||||
import net.dv8tion.jda.api.audio.AudioSendHandler;
|
||||
import net.dv8tion.jda.internal.utils.Checks;
|
||||
|
||||
import net.dv8tion.jda.core.audio.AudioSendHandler;
|
||||
import net.dv8tion.jda.core.utils.Checks;
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
public final class AudioPlayerSendHandler implements AudioSendHandler {
|
||||
private final AudioPlayer audioPlayer;
|
||||
@@ -37,8 +32,8 @@ public final class AudioPlayerSendHandler implements AudioSendHandler {
|
||||
}
|
||||
|
||||
@Override
|
||||
public final byte[] provide20MsAudio() {
|
||||
return lastFrame.getData();
|
||||
public final ByteBuffer provide20MsAudio() {
|
||||
return ByteBuffer.wrap(lastFrame.getData());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,23 +1,16 @@
|
||||
package dev.logal.logalbot.audio;
|
||||
|
||||
// Copyright 2019 Logan Fick
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
/*
|
||||
* Copyright 2022 Logan Fick
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
import com.sedmelluq.discord.lavaplayer.track.AudioTrack;
|
||||
|
||||
import net.dv8tion.jda.core.entities.Member;
|
||||
import net.dv8tion.jda.core.utils.Checks;
|
||||
import net.dv8tion.jda.api.entities.Member;
|
||||
import net.dv8tion.jda.internal.utils.Checks;
|
||||
|
||||
public final class RequestedTrack {
|
||||
private final AudioTrack track;
|
||||
|
||||
@@ -1,41 +1,33 @@
|
||||
package dev.logal.logalbot.audio;
|
||||
|
||||
// Copyright 2019 Logan Fick
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
/*
|
||||
* Copyright 2022 Logan Fick
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
import com.sedmelluq.discord.lavaplayer.player.AudioLoadResultHandler;
|
||||
import com.sedmelluq.discord.lavaplayer.tools.FriendlyException;
|
||||
import com.sedmelluq.discord.lavaplayer.track.AudioPlaylist;
|
||||
import com.sedmelluq.discord.lavaplayer.track.AudioTrack;
|
||||
import com.sedmelluq.discord.lavaplayer.track.AudioTrackInfo;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import dev.logal.logalbot.MainThread;
|
||||
import dev.logal.logalbot.commands.CommandResponse;
|
||||
import dev.logal.logalbot.tasks.TrackAdditionTask;
|
||||
import dev.logal.logalbot.utils.AudioUtil;
|
||||
import dev.logal.logalbot.utils.PermissionManager;
|
||||
import dev.logal.logalbot.utils.TrackUtil;
|
||||
import net.dv8tion.jda.core.entities.Guild;
|
||||
import net.dv8tion.jda.core.entities.Member;
|
||||
import net.dv8tion.jda.core.entities.TextChannel;
|
||||
import net.dv8tion.jda.core.utils.Checks;
|
||||
import net.dv8tion.jda.api.entities.Guild;
|
||||
import net.dv8tion.jda.api.entities.Member;
|
||||
import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
|
||||
import net.dv8tion.jda.internal.utils.Checks;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public final class TrackLoadHandler implements AudioLoadResultHandler {
|
||||
private final Logger logger = LoggerFactory.getLogger(TrackLoadHandler.class);
|
||||
|
||||
@@ -1,46 +1,34 @@
|
||||
package dev.logal.logalbot.audio;
|
||||
|
||||
// Copyright 2019 Logan Fick
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedList;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
/*
|
||||
* Copyright 2022 Logan Fick
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
import com.sedmelluq.discord.lavaplayer.player.AudioPlayer;
|
||||
import com.sedmelluq.discord.lavaplayer.player.event.AudioEventAdapter;
|
||||
import com.sedmelluq.discord.lavaplayer.track.AudioTrack;
|
||||
import com.sedmelluq.discord.lavaplayer.track.AudioTrackEndReason;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import dev.logal.logalbot.MainThread;
|
||||
import dev.logal.logalbot.tasks.CloseAudioConnectionTask;
|
||||
import dev.logal.logalbot.tasks.OpenAudioConnectionTask;
|
||||
import dev.logal.logalbot.tasks.PlayNextTrackTask;
|
||||
import dev.logal.logalbot.utils.AudioUtil;
|
||||
import dev.logal.logalbot.utils.DataManager;
|
||||
import dev.logal.logalbot.utils.PermissionManager;
|
||||
import dev.logal.logalbot.utils.SkipTracker;
|
||||
import dev.logal.logalbot.utils.VoiceChannelUtil;
|
||||
import net.dv8tion.jda.core.entities.Guild;
|
||||
import net.dv8tion.jda.core.entities.Member;
|
||||
import net.dv8tion.jda.core.entities.User;
|
||||
import net.dv8tion.jda.core.entities.VoiceChannel;
|
||||
import net.dv8tion.jda.core.utils.Checks;
|
||||
import dev.logal.logalbot.utils.*;
|
||||
import net.dv8tion.jda.api.entities.Guild;
|
||||
import net.dv8tion.jda.api.entities.Member;
|
||||
import net.dv8tion.jda.api.entities.User;
|
||||
import net.dv8tion.jda.api.entities.channel.concrete.VoiceChannel;
|
||||
import net.dv8tion.jda.internal.utils.Checks;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedList;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public final class TrackScheduler extends AudioEventAdapter {
|
||||
private static final Logger logger = LoggerFactory.getLogger(TrackScheduler.class);
|
||||
|
||||
@@ -1,21 +1,16 @@
|
||||
package dev.logal.logalbot.commands;
|
||||
|
||||
// Copyright 2019 Logan Fick
|
||||
/*
|
||||
* Copyright 2022 Logan Fick
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import net.dv8tion.jda.core.entities.Member;
|
||||
import net.dv8tion.jda.core.entities.TextChannel;
|
||||
import net.dv8tion.jda.api.entities.Member;
|
||||
import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
|
||||
|
||||
public interface Command {
|
||||
CommandResponse execute(final String[] arguments, final Member executor, final TextChannel channel);
|
||||
|
||||
@@ -1,37 +1,27 @@
|
||||
package dev.logal.logalbot.commands;
|
||||
|
||||
// Copyright 2019 Logan Fick
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import com.vdurmont.emoji.Emoji;
|
||||
import com.vdurmont.emoji.EmojiManager;
|
||||
/*
|
||||
* Copyright 2022 Logan Fick
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
import dev.logal.logalbot.MainThread;
|
||||
import dev.logal.logalbot.tasks.MessageDeleteTask;
|
||||
import dev.logal.logalbot.tasks.ReactionCallbackExpireTask;
|
||||
import dev.logal.logalbot.utils.ReactionCallbackManager;
|
||||
import net.dv8tion.jda.core.MessageBuilder;
|
||||
import net.dv8tion.jda.core.entities.Member;
|
||||
import net.dv8tion.jda.core.entities.Message;
|
||||
import net.dv8tion.jda.core.entities.MessageEmbed;
|
||||
import net.dv8tion.jda.core.entities.TextChannel;
|
||||
import net.dv8tion.jda.core.entities.User;
|
||||
import net.dv8tion.jda.core.utils.Checks;
|
||||
import net.dv8tion.jda.api.entities.*;
|
||||
import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
|
||||
import net.dv8tion.jda.api.entities.emoji.Emoji;
|
||||
import net.dv8tion.jda.api.utils.messages.MessageCreateBuilder;
|
||||
import net.dv8tion.jda.internal.utils.Checks;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
|
||||
public final class CommandResponse {
|
||||
private final Emoji emoji;
|
||||
@@ -47,7 +37,7 @@ public final class CommandResponse {
|
||||
Checks.notEmpty(emoji, "Emoji");
|
||||
Checks.notEmpty(response, "Response");
|
||||
|
||||
this.emoji = EmojiManager.getForAlias(emoji);
|
||||
this.emoji = Emoji.fromUnicode(emoji);
|
||||
Checks.notNull(this.emoji, "Valid Emoji");
|
||||
this.response = response;
|
||||
}
|
||||
@@ -72,7 +62,7 @@ public final class CommandResponse {
|
||||
Checks.notEmpty(emoji, "Emoji");
|
||||
Checks.notNull(callback, "Callback");
|
||||
|
||||
this.callbacks.put(EmojiManager.getForAlias(emoji), callback);
|
||||
this.callbacks.put(Emoji.fromUnicode(emoji), callback);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -95,11 +85,11 @@ public final class CommandResponse {
|
||||
public final void sendResponse(final TextChannel channel) {
|
||||
Checks.notNull(channel, "Channel");
|
||||
|
||||
final MessageBuilder builder = new MessageBuilder();
|
||||
builder.setContent(this.emoji.getUnicode() + " " + this.response);
|
||||
final MessageCreateBuilder builder = new MessageCreateBuilder();
|
||||
builder.setContent(":" + this.emoji.getFormatted() + ": " + this.response);
|
||||
|
||||
if (this.responseEmbed != null) {
|
||||
builder.setEmbed(this.responseEmbed);
|
||||
builder.addEmbeds(this.responseEmbed);
|
||||
}
|
||||
|
||||
channel.sendMessage(builder.build()).queue(this::handleResponseCreation);
|
||||
|
||||
@@ -1,21 +1,15 @@
|
||||
package dev.logal.logalbot.commands;
|
||||
|
||||
// Copyright 2019 Logan Fick
|
||||
/*
|
||||
* Copyright 2022 Logan Fick
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import net.dv8tion.jda.core.entities.Member;
|
||||
import net.dv8tion.jda.core.entities.Message;
|
||||
import net.dv8tion.jda.api.entities.Member;
|
||||
import net.dv8tion.jda.api.entities.Message;
|
||||
|
||||
public interface ReactionCallback {
|
||||
void run(final Member reactor, final Message message);
|
||||
|
||||
@@ -1,30 +1,24 @@
|
||||
package dev.logal.logalbot.commands.administration;
|
||||
|
||||
// Copyright 2019 Logan Fick
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
/*
|
||||
* Copyright 2022 Logan Fick
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
import dev.logal.logalbot.commands.Command;
|
||||
import dev.logal.logalbot.commands.CommandResponse;
|
||||
import dev.logal.logalbot.utils.AudioUtil;
|
||||
import dev.logal.logalbot.utils.DataManager;
|
||||
import dev.logal.logalbot.utils.StringUtil;
|
||||
import net.dv8tion.jda.core.EmbedBuilder;
|
||||
import net.dv8tion.jda.core.entities.Guild;
|
||||
import net.dv8tion.jda.core.entities.Member;
|
||||
import net.dv8tion.jda.core.entities.TextChannel;
|
||||
import net.dv8tion.jda.api.EmbedBuilder;
|
||||
import net.dv8tion.jda.api.entities.Guild;
|
||||
import net.dv8tion.jda.api.entities.Member;
|
||||
import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public final class Settings implements Command {
|
||||
@Override
|
||||
|
||||
@@ -1,28 +1,22 @@
|
||||
package dev.logal.logalbot.commands.administration;
|
||||
|
||||
// Copyright 2019 Logan Fick
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
/*
|
||||
* Copyright 2022 Logan Fick
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
import dev.logal.logalbot.commands.Command;
|
||||
import dev.logal.logalbot.commands.CommandResponse;
|
||||
import dev.logal.logalbot.utils.PermissionManager;
|
||||
import net.dv8tion.jda.core.Permission;
|
||||
import net.dv8tion.jda.core.entities.Guild;
|
||||
import net.dv8tion.jda.core.entities.Member;
|
||||
import net.dv8tion.jda.core.entities.TextChannel;
|
||||
import net.dv8tion.jda.api.Permission;
|
||||
import net.dv8tion.jda.api.entities.Guild;
|
||||
import net.dv8tion.jda.api.entities.Member;
|
||||
import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public final class Whitelist implements Command {
|
||||
@Override
|
||||
|
||||
@@ -1,20 +1,12 @@
|
||||
package dev.logal.logalbot.commands.audio;
|
||||
|
||||
// Copyright 2019 Logan Fick
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
/*
|
||||
* Copyright 2022 Logan Fick
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
import dev.logal.logalbot.audio.RequestedTrack;
|
||||
import dev.logal.logalbot.commands.Command;
|
||||
@@ -22,9 +14,11 @@ import dev.logal.logalbot.commands.CommandResponse;
|
||||
import dev.logal.logalbot.utils.AudioUtil;
|
||||
import dev.logal.logalbot.utils.TrackUtil;
|
||||
import dev.logal.logalbot.utils.VoiceChannelUtil;
|
||||
import net.dv8tion.jda.core.entities.Guild;
|
||||
import net.dv8tion.jda.core.entities.Member;
|
||||
import net.dv8tion.jda.core.entities.TextChannel;
|
||||
import net.dv8tion.jda.api.entities.Guild;
|
||||
import net.dv8tion.jda.api.entities.Member;
|
||||
import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public final class ForceSkip implements Command {
|
||||
@Override
|
||||
|
||||
@@ -1,29 +1,23 @@
|
||||
package dev.logal.logalbot.commands.audio;
|
||||
|
||||
// Copyright 2019 Logan Fick
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
/*
|
||||
* Copyright 2022 Logan Fick
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
import dev.logal.logalbot.audio.TrackScheduler;
|
||||
import dev.logal.logalbot.commands.Command;
|
||||
import dev.logal.logalbot.commands.CommandResponse;
|
||||
import dev.logal.logalbot.utils.AudioUtil;
|
||||
import dev.logal.logalbot.utils.VoiceChannelUtil;
|
||||
import net.dv8tion.jda.core.entities.Guild;
|
||||
import net.dv8tion.jda.core.entities.Member;
|
||||
import net.dv8tion.jda.core.entities.TextChannel;
|
||||
import net.dv8tion.jda.api.entities.Guild;
|
||||
import net.dv8tion.jda.api.entities.Member;
|
||||
import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public final class Lock implements Command {
|
||||
@Override
|
||||
|
||||
@@ -1,26 +1,20 @@
|
||||
package dev.logal.logalbot.commands.audio;
|
||||
|
||||
// Copyright 2019 Logan Fick
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
/*
|
||||
* Copyright 2022 Logan Fick
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
import dev.logal.logalbot.commands.Command;
|
||||
import dev.logal.logalbot.commands.CommandResponse;
|
||||
import dev.logal.logalbot.utils.AudioUtil;
|
||||
import dev.logal.logalbot.utils.TrackUtil;
|
||||
import net.dv8tion.jda.core.entities.Guild;
|
||||
import net.dv8tion.jda.core.entities.Member;
|
||||
import net.dv8tion.jda.core.entities.TextChannel;
|
||||
import net.dv8tion.jda.api.entities.Guild;
|
||||
import net.dv8tion.jda.api.entities.Member;
|
||||
import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
|
||||
|
||||
public final class NowPlaying implements Command {
|
||||
@Override
|
||||
|
||||
@@ -1,28 +1,22 @@
|
||||
package dev.logal.logalbot.commands.audio;
|
||||
|
||||
// Copyright 2019 Logan Fick
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
/*
|
||||
* Copyright 2022 Logan Fick
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
import dev.logal.logalbot.commands.Command;
|
||||
import dev.logal.logalbot.commands.CommandResponse;
|
||||
import dev.logal.logalbot.utils.AudioUtil;
|
||||
import dev.logal.logalbot.utils.VoiceChannelUtil;
|
||||
import net.dv8tion.jda.core.entities.Guild;
|
||||
import net.dv8tion.jda.core.entities.Member;
|
||||
import net.dv8tion.jda.core.entities.TextChannel;
|
||||
import net.dv8tion.jda.api.entities.Guild;
|
||||
import net.dv8tion.jda.api.entities.Member;
|
||||
import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public final class Pause implements Command {
|
||||
@Override
|
||||
|
||||
@@ -1,22 +1,12 @@
|
||||
package dev.logal.logalbot.commands.audio;
|
||||
|
||||
// Copyright 2019 Logan Fick
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
/*
|
||||
* Copyright 2022 Logan Fick
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
import dev.logal.logalbot.audio.TrackScheduler;
|
||||
import dev.logal.logalbot.commands.Command;
|
||||
@@ -25,11 +15,15 @@ import dev.logal.logalbot.utils.AudioUtil;
|
||||
import dev.logal.logalbot.utils.DataManager;
|
||||
import dev.logal.logalbot.utils.PermissionManager;
|
||||
import dev.logal.logalbot.utils.VoiceChannelUtil;
|
||||
import net.dv8tion.jda.core.Permission;
|
||||
import net.dv8tion.jda.core.entities.Guild;
|
||||
import net.dv8tion.jda.core.entities.Member;
|
||||
import net.dv8tion.jda.core.entities.TextChannel;
|
||||
import net.dv8tion.jda.core.entities.VoiceChannel;
|
||||
import net.dv8tion.jda.api.Permission;
|
||||
import net.dv8tion.jda.api.entities.Guild;
|
||||
import net.dv8tion.jda.api.entities.Member;
|
||||
import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
|
||||
import net.dv8tion.jda.api.entities.channel.concrete.VoiceChannel;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public final class Play implements Command {
|
||||
@Override
|
||||
|
||||
@@ -1,21 +1,12 @@
|
||||
package dev.logal.logalbot.commands.audio;
|
||||
|
||||
// Copyright 2019 Logan Fick
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
/*
|
||||
* Copyright 2022 Logan Fick
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
import dev.logal.logalbot.MainThread;
|
||||
import dev.logal.logalbot.audio.RequestedTrack;
|
||||
@@ -25,9 +16,12 @@ import dev.logal.logalbot.tasks.CommandExecutionTask;
|
||||
import dev.logal.logalbot.utils.AudioUtil;
|
||||
import dev.logal.logalbot.utils.ReactionCallbackManager;
|
||||
import dev.logal.logalbot.utils.TrackUtil;
|
||||
import net.dv8tion.jda.core.entities.Guild;
|
||||
import net.dv8tion.jda.core.entities.Member;
|
||||
import net.dv8tion.jda.core.entities.TextChannel;
|
||||
import net.dv8tion.jda.api.entities.Guild;
|
||||
import net.dv8tion.jda.api.entities.Member;
|
||||
import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public final class Queue implements Command {
|
||||
@Override
|
||||
|
||||
@@ -1,20 +1,12 @@
|
||||
package dev.logal.logalbot.commands.audio;
|
||||
|
||||
// Copyright 2019 Logan Fick
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
/*
|
||||
* Copyright 2022 Logan Fick
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
import dev.logal.logalbot.MainThread;
|
||||
import dev.logal.logalbot.audio.RequestedTrack;
|
||||
@@ -22,15 +14,13 @@ import dev.logal.logalbot.audio.TrackScheduler;
|
||||
import dev.logal.logalbot.commands.Command;
|
||||
import dev.logal.logalbot.commands.CommandResponse;
|
||||
import dev.logal.logalbot.tasks.CommandExecutionTask;
|
||||
import dev.logal.logalbot.utils.AudioUtil;
|
||||
import dev.logal.logalbot.utils.ReactionCallbackManager;
|
||||
import dev.logal.logalbot.utils.StringUtil;
|
||||
import dev.logal.logalbot.utils.TrackUtil;
|
||||
import dev.logal.logalbot.utils.VoiceChannelUtil;
|
||||
import net.dv8tion.jda.core.Permission;
|
||||
import net.dv8tion.jda.core.entities.Guild;
|
||||
import net.dv8tion.jda.core.entities.Member;
|
||||
import net.dv8tion.jda.core.entities.TextChannel;
|
||||
import dev.logal.logalbot.utils.*;
|
||||
import net.dv8tion.jda.api.Permission;
|
||||
import net.dv8tion.jda.api.entities.Guild;
|
||||
import net.dv8tion.jda.api.entities.Member;
|
||||
import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public final class Remove implements Command {
|
||||
@Override
|
||||
|
||||
@@ -1,28 +1,22 @@
|
||||
package dev.logal.logalbot.commands.audio;
|
||||
|
||||
// Copyright 2019 Logan Fick
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
/*
|
||||
* Copyright 2022 Logan Fick
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
import dev.logal.logalbot.commands.Command;
|
||||
import dev.logal.logalbot.commands.CommandResponse;
|
||||
import dev.logal.logalbot.utils.AudioUtil;
|
||||
import dev.logal.logalbot.utils.VoiceChannelUtil;
|
||||
import net.dv8tion.jda.core.entities.Guild;
|
||||
import net.dv8tion.jda.core.entities.Member;
|
||||
import net.dv8tion.jda.core.entities.TextChannel;
|
||||
import net.dv8tion.jda.api.entities.Guild;
|
||||
import net.dv8tion.jda.api.entities.Member;
|
||||
import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public final class Reset implements Command {
|
||||
@Override
|
||||
|
||||
@@ -1,29 +1,23 @@
|
||||
package dev.logal.logalbot.commands.audio;
|
||||
|
||||
// Copyright 2019 Logan Fick
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
/*
|
||||
* Copyright 2022 Logan Fick
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
import dev.logal.logalbot.audio.TrackScheduler;
|
||||
import dev.logal.logalbot.commands.Command;
|
||||
import dev.logal.logalbot.commands.CommandResponse;
|
||||
import dev.logal.logalbot.utils.AudioUtil;
|
||||
import dev.logal.logalbot.utils.VoiceChannelUtil;
|
||||
import net.dv8tion.jda.core.entities.Guild;
|
||||
import net.dv8tion.jda.core.entities.Member;
|
||||
import net.dv8tion.jda.core.entities.TextChannel;
|
||||
import net.dv8tion.jda.api.entities.Guild;
|
||||
import net.dv8tion.jda.api.entities.Member;
|
||||
import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public final class Shuffle implements Command {
|
||||
@Override
|
||||
|
||||
@@ -1,20 +1,12 @@
|
||||
package dev.logal.logalbot.commands.audio;
|
||||
|
||||
// Copyright 2019 Logan Fick
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
/*
|
||||
* Copyright 2022 Logan Fick
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
import dev.logal.logalbot.audio.RequestedTrack;
|
||||
import dev.logal.logalbot.commands.Command;
|
||||
@@ -23,9 +15,11 @@ import dev.logal.logalbot.utils.AudioUtil;
|
||||
import dev.logal.logalbot.utils.SkipTracker;
|
||||
import dev.logal.logalbot.utils.TrackUtil;
|
||||
import dev.logal.logalbot.utils.VoiceChannelUtil;
|
||||
import net.dv8tion.jda.core.entities.Guild;
|
||||
import net.dv8tion.jda.core.entities.Member;
|
||||
import net.dv8tion.jda.core.entities.TextChannel;
|
||||
import net.dv8tion.jda.api.entities.Guild;
|
||||
import net.dv8tion.jda.api.entities.Member;
|
||||
import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public final class Skip implements Command {
|
||||
@Override
|
||||
|
||||
@@ -1,28 +1,22 @@
|
||||
package dev.logal.logalbot.commands.audio;
|
||||
|
||||
// Copyright 2019 Logan Fick
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
/*
|
||||
* Copyright 2022 Logan Fick
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
import dev.logal.logalbot.commands.Command;
|
||||
import dev.logal.logalbot.commands.CommandResponse;
|
||||
import dev.logal.logalbot.utils.AudioUtil;
|
||||
import dev.logal.logalbot.utils.VoiceChannelUtil;
|
||||
import net.dv8tion.jda.core.entities.Guild;
|
||||
import net.dv8tion.jda.core.entities.Member;
|
||||
import net.dv8tion.jda.core.entities.TextChannel;
|
||||
import net.dv8tion.jda.api.entities.Guild;
|
||||
import net.dv8tion.jda.api.entities.Member;
|
||||
import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public final class Volume implements Command {
|
||||
@Override
|
||||
|
||||
@@ -1,26 +1,20 @@
|
||||
package dev.logal.logalbot.commands.fun;
|
||||
|
||||
// Copyright 2019 Logan Fick
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import java.security.SecureRandom;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
/*
|
||||
* Copyright 2022 Logan Fick
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
import dev.logal.logalbot.commands.Command;
|
||||
import dev.logal.logalbot.commands.CommandResponse;
|
||||
import net.dv8tion.jda.core.entities.Member;
|
||||
import net.dv8tion.jda.core.entities.TextChannel;
|
||||
import net.dv8tion.jda.api.entities.Member;
|
||||
import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
|
||||
|
||||
import java.security.SecureRandom;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public final class Dice implements Command {
|
||||
private final SecureRandom rng = new SecureRandom();
|
||||
|
||||
@@ -1,31 +1,24 @@
|
||||
package dev.logal.logalbot.commands.fun;
|
||||
|
||||
// Copyright 2019 Logan Fick
|
||||
/*
|
||||
* Copyright 2022 Logan Fick
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
import com.vdurmont.emoji.EmojiManager;
|
||||
import dev.logal.logalbot.commands.Command;
|
||||
import dev.logal.logalbot.commands.CommandResponse;
|
||||
import dev.logal.logalbot.utils.StringUtil;
|
||||
import net.dv8tion.jda.api.entities.Member;
|
||||
import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import com.vdurmont.emoji.EmojiManager;
|
||||
|
||||
import dev.logal.logalbot.commands.Command;
|
||||
import dev.logal.logalbot.commands.CommandResponse;
|
||||
import dev.logal.logalbot.utils.StringUtil;
|
||||
import net.dv8tion.jda.core.entities.Member;
|
||||
import net.dv8tion.jda.core.entities.TextChannel;
|
||||
|
||||
public final class EightBall implements Command {
|
||||
private final ArrayList<String> responses = new ArrayList<>(20);
|
||||
private final Random rng = new Random();
|
||||
|
||||
@@ -1,23 +1,17 @@
|
||||
package dev.logal.logalbot.commands.general;
|
||||
|
||||
// Copyright 2019 Logan Fick
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
/*
|
||||
* Copyright 2022 Logan Fick
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
import dev.logal.logalbot.commands.Command;
|
||||
import dev.logal.logalbot.commands.CommandResponse;
|
||||
import net.dv8tion.jda.core.entities.Member;
|
||||
import net.dv8tion.jda.core.entities.TextChannel;
|
||||
import net.dv8tion.jda.api.entities.Member;
|
||||
import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
|
||||
|
||||
public final class About implements Command {
|
||||
@Override
|
||||
|
||||
@@ -1,24 +1,18 @@
|
||||
package dev.logal.logalbot.commands.general;
|
||||
|
||||
// Copyright 2019 Logan Fick
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
/*
|
||||
* Copyright 2022 Logan Fick
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
import dev.logal.logalbot.commands.Command;
|
||||
import dev.logal.logalbot.commands.CommandResponse;
|
||||
import net.dv8tion.jda.core.EmbedBuilder;
|
||||
import net.dv8tion.jda.core.entities.Member;
|
||||
import net.dv8tion.jda.core.entities.TextChannel;
|
||||
import net.dv8tion.jda.api.EmbedBuilder;
|
||||
import net.dv8tion.jda.api.entities.Member;
|
||||
import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
|
||||
|
||||
public final class Help implements Command {
|
||||
@Override
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
package dev.logal.logalbot.events;
|
||||
|
||||
// Copyright 2019 Logan Fick
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import dev.logal.logalbot.MainThread;
|
||||
import dev.logal.logalbot.tasks.ReactionCallbackExecutionTask;
|
||||
import net.dv8tion.jda.core.events.message.guild.react.GuildMessageReactionAddEvent;
|
||||
import net.dv8tion.jda.core.hooks.ListenerAdapter;
|
||||
import net.dv8tion.jda.core.utils.Checks;
|
||||
|
||||
public final class GuildMessageReactionAdd extends ListenerAdapter {
|
||||
@Override
|
||||
public final void onGuildMessageReactionAdd(final GuildMessageReactionAddEvent event) {
|
||||
Checks.notNull(event, "Event");
|
||||
|
||||
if (!event.getUser().equals(event.getJDA().getSelfUser())) {
|
||||
MainThread.scheduleImmediately(new ReactionCallbackExecutionTask(event.getMessageIdLong(),
|
||||
event.getChannel(), event.getMember(), event.getReactionEmote().getName()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,23 +1,17 @@
|
||||
package dev.logal.logalbot.events;
|
||||
|
||||
// Copyright 2019 Logan Fick
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
/*
|
||||
* Copyright 2022 Logan Fick
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
import dev.logal.logalbot.utils.AudioUtil;
|
||||
import net.dv8tion.jda.core.events.guild.GuildReadyEvent;
|
||||
import net.dv8tion.jda.core.hooks.ListenerAdapter;
|
||||
import net.dv8tion.jda.core.utils.Checks;
|
||||
import net.dv8tion.jda.api.events.guild.GuildReadyEvent;
|
||||
import net.dv8tion.jda.api.hooks.ListenerAdapter;
|
||||
import net.dv8tion.jda.internal.utils.Checks;
|
||||
|
||||
public final class GuildReady extends ListenerAdapter {
|
||||
@Override
|
||||
|
||||
@@ -1,64 +0,0 @@
|
||||
package dev.logal.logalbot.events;
|
||||
|
||||
// Copyright 2019 Logan Fick
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import dev.logal.logalbot.MainThread;
|
||||
import dev.logal.logalbot.tasks.ResetAudioPlayerTask;
|
||||
import dev.logal.logalbot.utils.AudioUtil;
|
||||
import net.dv8tion.jda.core.entities.Guild;
|
||||
import net.dv8tion.jda.core.entities.Member;
|
||||
import net.dv8tion.jda.core.entities.VoiceChannel;
|
||||
import net.dv8tion.jda.core.events.guild.voice.GuildVoiceMoveEvent;
|
||||
import net.dv8tion.jda.core.hooks.ListenerAdapter;
|
||||
import net.dv8tion.jda.core.utils.Checks;
|
||||
|
||||
public final class GuildVoiceMove extends ListenerAdapter {
|
||||
private static final Logger logger = LoggerFactory.getLogger(GuildVoiceMove.class);
|
||||
|
||||
@Override
|
||||
public final void onGuildVoiceMove(final GuildVoiceMoveEvent event) {
|
||||
Checks.notNull(event, "Event");
|
||||
|
||||
final Guild guild = event.getGuild();
|
||||
if (!AudioUtil.isAudioConnectionOpen(guild)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!AudioUtil.isTrackLoaded(guild)) {
|
||||
return;
|
||||
}
|
||||
|
||||
final Member member = event.getMember();
|
||||
|
||||
if (member.getUser().equals(event.getJDA().getSelfUser())) {
|
||||
return;
|
||||
}
|
||||
|
||||
final VoiceChannel leftChannel = event.getChannelLeft();
|
||||
if (leftChannel.equals(AudioUtil.getVoiceChannelConnectedTo(guild))) {
|
||||
final List<Member> members = leftChannel.getMembers();
|
||||
if (members.size() == 1 && members.get(0).getUser().equals(event.getJDA().getSelfUser())) {
|
||||
logger.info("All listeners left " + leftChannel.getName() + " (" + leftChannel.getId() + ") in "
|
||||
+ guild.getName() + " (" + guild.getId() + ").");
|
||||
MainThread.scheduleImmediately(new ResetAudioPlayerTask(guild));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,39 +1,32 @@
|
||||
package dev.logal.logalbot.events;
|
||||
|
||||
// Copyright 2019 Logan Fick
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
/*
|
||||
* Copyright 2022 Logan Fick
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
import dev.logal.logalbot.MainThread;
|
||||
import dev.logal.logalbot.tasks.ResetAudioPlayerTask;
|
||||
import dev.logal.logalbot.utils.AudioUtil;
|
||||
import net.dv8tion.jda.core.entities.Guild;
|
||||
import net.dv8tion.jda.core.entities.Member;
|
||||
import net.dv8tion.jda.core.entities.VoiceChannel;
|
||||
import net.dv8tion.jda.core.events.guild.voice.GuildVoiceLeaveEvent;
|
||||
import net.dv8tion.jda.core.hooks.ListenerAdapter;
|
||||
import net.dv8tion.jda.core.utils.Checks;
|
||||
import net.dv8tion.jda.api.entities.Guild;
|
||||
import net.dv8tion.jda.api.entities.Member;
|
||||
import net.dv8tion.jda.api.entities.channel.concrete.VoiceChannel;
|
||||
import net.dv8tion.jda.api.events.guild.voice.GuildVoiceUpdateEvent;
|
||||
import net.dv8tion.jda.api.hooks.ListenerAdapter;
|
||||
import net.dv8tion.jda.internal.utils.Checks;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public final class GuildVoiceLeave extends ListenerAdapter {
|
||||
private static final Logger logger = LoggerFactory.getLogger(GuildVoiceLeave.class);
|
||||
import java.util.List;
|
||||
|
||||
public final class GuildVoiceUpdate extends ListenerAdapter {
|
||||
private static final Logger logger = LoggerFactory.getLogger(GuildVoiceUpdate.class);
|
||||
|
||||
@Override
|
||||
public final void onGuildVoiceLeave(final GuildVoiceLeaveEvent event) {
|
||||
public final void onGuildVoiceUpdate(final GuildVoiceUpdateEvent event) {
|
||||
Checks.notNull(event, "Event");
|
||||
|
||||
final Guild guild = event.getGuild();
|
||||
@@ -51,7 +44,7 @@ public final class GuildVoiceLeave extends ListenerAdapter {
|
||||
return;
|
||||
}
|
||||
|
||||
final VoiceChannel leftChannel = event.getChannelLeft();
|
||||
final VoiceChannel leftChannel = event.getChannelLeft().asVoiceChannel(); // TODO: This will break.
|
||||
if (leftChannel.equals(AudioUtil.getVoiceChannelConnectedTo(guild))) {
|
||||
final List<Member> members = leftChannel.getMembers();
|
||||
if (members.size() == 1 && members.get(0).getUser().equals(event.getJDA().getSelfUser())) {
|
||||
@@ -0,0 +1,27 @@
|
||||
package dev.logal.logalbot.events;
|
||||
|
||||
/*
|
||||
* Copyright 2022 Logan Fick
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
import dev.logal.logalbot.MainThread;
|
||||
import dev.logal.logalbot.tasks.ReactionCallbackExecutionTask;
|
||||
import net.dv8tion.jda.api.events.message.react.MessageReactionAddEvent;
|
||||
import net.dv8tion.jda.api.hooks.ListenerAdapter;
|
||||
import net.dv8tion.jda.internal.utils.Checks;
|
||||
|
||||
public final class MessageReactionAdd extends ListenerAdapter {
|
||||
@Override
|
||||
public final void onMessageReactionAdd(final MessageReactionAddEvent event) {
|
||||
Checks.notNull(event, "Event");
|
||||
|
||||
if (!event.getUser().equals(event.getJDA().getSelfUser())) {
|
||||
MainThread.scheduleImmediately(new ReactionCallbackExecutionTask(event.getMessageIdLong(),
|
||||
event.getChannel().asTextChannel(), event.getMember(), event.getEmoji().getName())); // TODO: This will break.
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,52 +1,43 @@
|
||||
package dev.logal.logalbot.events;
|
||||
|
||||
// Copyright 2019 Logan Fick
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
/*
|
||||
* Copyright 2022 Logan Fick
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
import dev.logal.logalbot.MainThread;
|
||||
import dev.logal.logalbot.tasks.CommandExecutionTask;
|
||||
import dev.logal.logalbot.utils.DataManager;
|
||||
import net.dv8tion.jda.core.Permission;
|
||||
import net.dv8tion.jda.core.entities.Guild;
|
||||
import net.dv8tion.jda.core.entities.Member;
|
||||
import net.dv8tion.jda.core.entities.Message;
|
||||
import net.dv8tion.jda.core.entities.SelfUser;
|
||||
import net.dv8tion.jda.core.entities.TextChannel;
|
||||
import net.dv8tion.jda.core.events.message.guild.GuildMessageReceivedEvent;
|
||||
import net.dv8tion.jda.core.hooks.ListenerAdapter;
|
||||
import net.dv8tion.jda.core.utils.Checks;
|
||||
import net.dv8tion.jda.api.Permission;
|
||||
import net.dv8tion.jda.api.entities.*;
|
||||
import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
|
||||
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
|
||||
import net.dv8tion.jda.api.hooks.ListenerAdapter;
|
||||
import net.dv8tion.jda.internal.utils.Checks;
|
||||
|
||||
public final class GuildMessageReceived extends ListenerAdapter {
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public final class MessageReceived extends ListenerAdapter {
|
||||
@Override
|
||||
public final void onGuildMessageReceived(final GuildMessageReceivedEvent event) {
|
||||
public final void onMessageReceived(final MessageReceivedEvent event) {
|
||||
Checks.notNull(event, "Event");
|
||||
|
||||
final Guild guild = event.getGuild();
|
||||
final Member self = guild.getSelfMember();
|
||||
final TextChannel channel = event.getChannel();
|
||||
final TextChannel channel = event.getChannel().asTextChannel(); // TODO: This will break.
|
||||
final Message message = event.getMessage();
|
||||
if (event.getAuthor().isBot() || message.isTTS() || !self.hasPermission(channel, Permission.MESSAGE_WRITE)
|
||||
if (event.getAuthor().isBot() || message.isTTS() || !self.hasPermission(channel, Permission.MESSAGE_SEND)
|
||||
|| !self.hasPermission(channel, Permission.MESSAGE_EMBED_LINKS)) {
|
||||
return;
|
||||
}
|
||||
|
||||
final String content = message.getContentRaw();
|
||||
final SelfUser selfUser = event.getJDA().getSelfUser();
|
||||
final List<Member> mentionedMembers = message.getMentionedMembers();
|
||||
final List<Member> mentionedMembers = message.getMentions().getMembers();
|
||||
final Member author = event.getMember();
|
||||
if (mentionedMembers.size() >= 1 && mentionedMembers.get(0).getUser().getIdLong() == selfUser.getIdLong()
|
||||
&& (content.startsWith(self.getAsMention()) || content.startsWith(selfUser.getAsMention()))) {
|
||||
@@ -1,22 +1,16 @@
|
||||
package dev.logal.logalbot.tasks;
|
||||
|
||||
// Copyright 2019 Logan Fick
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
/*
|
||||
* Copyright 2022 Logan Fick
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
import dev.logal.logalbot.utils.AudioUtil;
|
||||
import net.dv8tion.jda.core.entities.Guild;
|
||||
import net.dv8tion.jda.core.utils.Checks;
|
||||
import net.dv8tion.jda.api.entities.Guild;
|
||||
import net.dv8tion.jda.internal.utils.Checks;
|
||||
|
||||
public final class CloseAudioConnectionTask implements Runnable {
|
||||
private final Guild guild;
|
||||
|
||||
@@ -1,23 +1,17 @@
|
||||
package dev.logal.logalbot.tasks;
|
||||
|
||||
// Copyright 2019 Logan Fick
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
/*
|
||||
* Copyright 2022 Logan Fick
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
import dev.logal.logalbot.utils.CommandManager;
|
||||
import net.dv8tion.jda.core.entities.Member;
|
||||
import net.dv8tion.jda.core.entities.TextChannel;
|
||||
import net.dv8tion.jda.core.utils.Checks;
|
||||
import net.dv8tion.jda.api.entities.Member;
|
||||
import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
|
||||
import net.dv8tion.jda.internal.utils.Checks;
|
||||
|
||||
public final class CommandExecutionTask implements Runnable {
|
||||
private final String[] command;
|
||||
|
||||
@@ -1,22 +1,16 @@
|
||||
package dev.logal.logalbot.tasks;
|
||||
|
||||
// Copyright 2019 Logan Fick
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
/*
|
||||
* Copyright 2022 Logan Fick
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
import dev.logal.logalbot.utils.ReactionCallbackManager;
|
||||
import net.dv8tion.jda.core.entities.Message;
|
||||
import net.dv8tion.jda.core.utils.Checks;
|
||||
import net.dv8tion.jda.api.entities.Message;
|
||||
import net.dv8tion.jda.internal.utils.Checks;
|
||||
|
||||
public final class MessageDeleteTask implements Runnable {
|
||||
private final Message messageToDelete;
|
||||
|
||||
@@ -1,22 +1,16 @@
|
||||
package dev.logal.logalbot.tasks;
|
||||
|
||||
// Copyright 2019 Logan Fick
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
/*
|
||||
* Copyright 2022 Logan Fick
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
import dev.logal.logalbot.utils.AudioUtil;
|
||||
import net.dv8tion.jda.core.entities.VoiceChannel;
|
||||
import net.dv8tion.jda.core.utils.Checks;
|
||||
import net.dv8tion.jda.api.entities.channel.concrete.VoiceChannel;
|
||||
import net.dv8tion.jda.internal.utils.Checks;
|
||||
|
||||
public final class OpenAudioConnectionTask implements Runnable {
|
||||
private final VoiceChannel channel;
|
||||
|
||||
@@ -1,22 +1,16 @@
|
||||
package dev.logal.logalbot.tasks;
|
||||
|
||||
// Copyright 2019 Logan Fick
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
/*
|
||||
* Copyright 2022 Logan Fick
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
import dev.logal.logalbot.utils.AudioUtil;
|
||||
import net.dv8tion.jda.core.entities.Guild;
|
||||
import net.dv8tion.jda.core.utils.Checks;
|
||||
import net.dv8tion.jda.api.entities.Guild;
|
||||
import net.dv8tion.jda.internal.utils.Checks;
|
||||
|
||||
public final class PlayNextTrackTask implements Runnable {
|
||||
private final Guild guild;
|
||||
|
||||
@@ -1,23 +1,17 @@
|
||||
package dev.logal.logalbot.tasks;
|
||||
|
||||
// Copyright 2019 Logan Fick
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
/*
|
||||
* Copyright 2022 Logan Fick
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
import dev.logal.logalbot.utils.ReactionCallbackManager;
|
||||
import net.dv8tion.jda.core.entities.Member;
|
||||
import net.dv8tion.jda.core.entities.TextChannel;
|
||||
import net.dv8tion.jda.core.utils.Checks;
|
||||
import net.dv8tion.jda.api.entities.Member;
|
||||
import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
|
||||
import net.dv8tion.jda.internal.utils.Checks;
|
||||
|
||||
public final class ReactionCallbackExecutionTask implements Runnable {
|
||||
private final long messageID;
|
||||
|
||||
@@ -1,22 +1,16 @@
|
||||
package dev.logal.logalbot.tasks;
|
||||
|
||||
// Copyright 2019 Logan Fick
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
/*
|
||||
* Copyright 2022 Logan Fick
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
import dev.logal.logalbot.utils.ReactionCallbackManager;
|
||||
import net.dv8tion.jda.core.entities.Message;
|
||||
import net.dv8tion.jda.core.utils.Checks;
|
||||
import net.dv8tion.jda.api.entities.Message;
|
||||
import net.dv8tion.jda.internal.utils.Checks;
|
||||
|
||||
public final class ReactionCallbackExpireTask implements Runnable {
|
||||
private final Message messageToExpire;
|
||||
|
||||
@@ -1,22 +1,16 @@
|
||||
package dev.logal.logalbot.tasks;
|
||||
|
||||
// Copyright 2019 Logan Fick
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
/*
|
||||
* Copyright 2022 Logan Fick
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
import dev.logal.logalbot.utils.AudioUtil;
|
||||
import net.dv8tion.jda.core.entities.Guild;
|
||||
import net.dv8tion.jda.core.utils.Checks;
|
||||
import net.dv8tion.jda.api.entities.Guild;
|
||||
import net.dv8tion.jda.internal.utils.Checks;
|
||||
|
||||
public final class ResetAudioPlayerTask implements Runnable {
|
||||
private final Guild guild;
|
||||
|
||||
@@ -1,27 +1,21 @@
|
||||
package dev.logal.logalbot.tasks;
|
||||
|
||||
// Copyright 2019 Logan Fick
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
/*
|
||||
* Copyright 2022 Logan Fick
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
import dev.logal.logalbot.audio.RequestedTrack;
|
||||
import dev.logal.logalbot.audio.TrackScheduler;
|
||||
import dev.logal.logalbot.utils.AudioUtil;
|
||||
import net.dv8tion.jda.core.entities.Guild;
|
||||
import net.dv8tion.jda.core.utils.Checks;
|
||||
import net.dv8tion.jda.api.entities.Guild;
|
||||
import net.dv8tion.jda.internal.utils.Checks;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
public final class TrackAdditionTask implements Runnable {
|
||||
private final Guild guild;
|
||||
|
||||
@@ -1,39 +1,31 @@
|
||||
package dev.logal.logalbot.utils;
|
||||
|
||||
// Copyright 2019 Logan Fick
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import java.util.HashMap;
|
||||
/*
|
||||
* Copyright 2022 Logan Fick
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
import com.sedmelluq.discord.lavaplayer.player.AudioPlayer;
|
||||
import com.sedmelluq.discord.lavaplayer.player.AudioPlayerManager;
|
||||
import com.sedmelluq.discord.lavaplayer.player.DefaultAudioPlayerManager;
|
||||
import com.sedmelluq.discord.lavaplayer.source.AudioSourceManagers;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import dev.logal.logalbot.audio.AudioPlayerSendHandler;
|
||||
import dev.logal.logalbot.audio.RequestedTrack;
|
||||
import dev.logal.logalbot.audio.TrackLoadHandler;
|
||||
import dev.logal.logalbot.audio.TrackScheduler;
|
||||
import net.dv8tion.jda.core.entities.Guild;
|
||||
import net.dv8tion.jda.core.entities.Member;
|
||||
import net.dv8tion.jda.core.entities.TextChannel;
|
||||
import net.dv8tion.jda.core.entities.VoiceChannel;
|
||||
import net.dv8tion.jda.core.managers.AudioManager;
|
||||
import net.dv8tion.jda.core.utils.Checks;
|
||||
import net.dv8tion.jda.api.entities.Guild;
|
||||
import net.dv8tion.jda.api.entities.Member;
|
||||
import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
|
||||
import net.dv8tion.jda.api.entities.channel.concrete.VoiceChannel;
|
||||
import net.dv8tion.jda.api.managers.AudioManager;
|
||||
import net.dv8tion.jda.internal.utils.Checks;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
public final class AudioUtil {
|
||||
private static final Logger logger = LoggerFactory.getLogger(AudioUtil.class);
|
||||
@@ -89,7 +81,7 @@ public final class AudioUtil {
|
||||
public static final VoiceChannel getVoiceChannelConnectedTo(final Guild guild) {
|
||||
Checks.notNull(guild, "Guild");
|
||||
|
||||
return guild.getAudioManager().getConnectedChannel();
|
||||
return guild.getAudioManager().getConnectedChannel().asVoiceChannel(); // TODO: This will break.
|
||||
}
|
||||
|
||||
public static final boolean isAudioConnectionOpen(final Guild guild) {
|
||||
|
||||
@@ -1,33 +1,25 @@
|
||||
package dev.logal.logalbot.utils;
|
||||
|
||||
// Copyright 2019 Logan Fick
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
/*
|
||||
* Copyright 2022 Logan Fick
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
import dev.logal.logalbot.commands.Command;
|
||||
import dev.logal.logalbot.commands.CommandResponse;
|
||||
import net.dv8tion.jda.core.entities.Guild;
|
||||
import net.dv8tion.jda.core.entities.Member;
|
||||
import net.dv8tion.jda.core.entities.TextChannel;
|
||||
import net.dv8tion.jda.core.utils.Checks;
|
||||
import net.dv8tion.jda.api.entities.Guild;
|
||||
import net.dv8tion.jda.api.entities.Member;
|
||||
import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
|
||||
import net.dv8tion.jda.internal.utils.Checks;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public final class CommandManager {
|
||||
private static final Logger logger = LoggerFactory.getLogger(CommandManager.class);
|
||||
|
||||
@@ -1,26 +1,19 @@
|
||||
package dev.logal.logalbot.utils;
|
||||
|
||||
// Copyright 2019 Logan Fick
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
/*
|
||||
* Copyright 2022 Logan Fick
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
import net.dv8tion.jda.api.entities.Guild;
|
||||
import net.dv8tion.jda.api.entities.Member;
|
||||
import net.dv8tion.jda.api.entities.User;
|
||||
import net.dv8tion.jda.internal.utils.Checks;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import net.dv8tion.jda.core.entities.Guild;
|
||||
import net.dv8tion.jda.core.entities.Member;
|
||||
import net.dv8tion.jda.core.entities.User;
|
||||
import net.dv8tion.jda.core.utils.Checks;
|
||||
import redis.clients.jedis.Jedis;
|
||||
|
||||
public final class DataManager {
|
||||
@@ -37,7 +30,7 @@ public final class DataManager {
|
||||
|
||||
public static final void verifyConnection() {
|
||||
if (!jedis.isConnected()) {
|
||||
jedis = new Jedis(host);
|
||||
jedis = new Jedis(host, 6379);
|
||||
|
||||
if (password != null) {
|
||||
jedis.auth(password);
|
||||
|
||||
@@ -1,26 +1,19 @@
|
||||
package dev.logal.logalbot.utils;
|
||||
|
||||
// Copyright 2019 Logan Fick
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License
|
||||
/*
|
||||
* Copyright 2022 Logan Fick
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
import net.dv8tion.jda.api.Permission;
|
||||
import net.dv8tion.jda.api.entities.Member;
|
||||
import net.dv8tion.jda.internal.utils.Checks;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import net.dv8tion.jda.core.Permission;
|
||||
import net.dv8tion.jda.core.entities.Member;
|
||||
import net.dv8tion.jda.core.utils.Checks;
|
||||
|
||||
public final class PermissionManager {
|
||||
private static final Logger logger = LoggerFactory.getLogger(PermissionManager.class);
|
||||
|
||||
|
||||
@@ -1,30 +1,22 @@
|
||||
package dev.logal.logalbot.utils;
|
||||
|
||||
// Copyright 2019 Logan Fick
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import com.vdurmont.emoji.Emoji;
|
||||
import com.vdurmont.emoji.EmojiManager;
|
||||
/*
|
||||
* Copyright 2022 Logan Fick
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
import dev.logal.logalbot.commands.ReactionCallback;
|
||||
import net.dv8tion.jda.core.entities.Member;
|
||||
import net.dv8tion.jda.core.entities.Message;
|
||||
import net.dv8tion.jda.core.entities.TextChannel;
|
||||
import net.dv8tion.jda.core.entities.User;
|
||||
import net.dv8tion.jda.core.utils.Checks;
|
||||
import net.dv8tion.jda.api.entities.Member;
|
||||
import net.dv8tion.jda.api.entities.Message;
|
||||
import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
|
||||
import net.dv8tion.jda.api.entities.User;
|
||||
import net.dv8tion.jda.api.entities.emoji.Emoji;
|
||||
import net.dv8tion.jda.internal.utils.Checks;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
public final class ReactionCallbackManager {
|
||||
private static final HashMap<Long, HashMap<Emoji, ReactionCallback>> callbackDictionary = new HashMap<>();
|
||||
@@ -35,7 +27,7 @@ public final class ReactionCallbackManager {
|
||||
}
|
||||
|
||||
public static final void registerCallback(final Message message, final Emoji emoji,
|
||||
final ReactionCallback callback) {
|
||||
final ReactionCallback callback) {
|
||||
Checks.notNull(message, "Message");
|
||||
Checks.notNull(emoji, "Emoji");
|
||||
Checks.notNull(callback, "Callback");
|
||||
@@ -45,7 +37,7 @@ public final class ReactionCallbackManager {
|
||||
}
|
||||
|
||||
callbackDictionary.get(message.getIdLong()).put(emoji, callback);
|
||||
message.addReaction(emoji.getUnicode()).queue();
|
||||
message.addReaction(emoji).queue();
|
||||
}
|
||||
|
||||
public static final void setCallbackTarget(final Message message, final User user) {
|
||||
@@ -62,7 +54,7 @@ public final class ReactionCallbackManager {
|
||||
message.delete().queue();
|
||||
} else {
|
||||
if (callbackDictionary.containsKey(message.getIdLong())) {
|
||||
message.addReaction(EmojiManager.getForAlias("no_entry").getUnicode()).queue();
|
||||
message.addReaction(net.dv8tion.jda.api.entities.emoji.Emoji.fromUnicode("no_entry")).queue();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,13 +63,14 @@ public final class ReactionCallbackManager {
|
||||
}
|
||||
|
||||
public static final void executeCallback(final long messageID, final TextChannel channel, final Member reactor,
|
||||
final String emoji) {
|
||||
final String emoji) {
|
||||
Checks.notNegative(messageID, "Message ID");
|
||||
Checks.notNull(channel, "Channel");
|
||||
Checks.notNull(reactor, "Reactor");
|
||||
Checks.notEmpty(emoji, "Emoji");
|
||||
|
||||
channel.getMessageById(messageID).queue((message) -> {
|
||||
// TODO: This is broke.
|
||||
/*channel.getMessageById(messageID).queue((message) -> {
|
||||
if (callbackDictionary.containsKey(messageID)) {
|
||||
if (targetDictionary.containsKey(messageID)
|
||||
&& !targetDictionary.get(messageID).equals(reactor.getUser().getIdLong())) {
|
||||
@@ -89,6 +82,6 @@ public final class ReactionCallbackManager {
|
||||
callbackDictionary.get(messageID).get(parsedEmoji).run(reactor, message);
|
||||
}
|
||||
}
|
||||
});
|
||||
});*/
|
||||
}
|
||||
}
|
||||
@@ -1,26 +1,21 @@
|
||||
package dev.logal.logalbot.utils;
|
||||
|
||||
// Copyright 2019 Logan Fick
|
||||
/*
|
||||
* Copyright 2022 Logan Fick
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
import net.dv8tion.jda.api.entities.Guild;
|
||||
import net.dv8tion.jda.api.entities.Member;
|
||||
import net.dv8tion.jda.internal.utils.Checks;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
import net.dv8tion.jda.core.entities.Guild;
|
||||
import net.dv8tion.jda.core.entities.Member;
|
||||
import net.dv8tion.jda.core.utils.Checks;
|
||||
|
||||
public final class SkipTracker {
|
||||
private static final HashMap<Long, ArrayList<Long>> skipVotesDictionary = new HashMap<>();
|
||||
|
||||
|
||||
@@ -1,23 +1,16 @@
|
||||
package dev.logal.logalbot.utils;
|
||||
|
||||
// Copyright 2019 Logan Fick
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
/*
|
||||
* Copyright 2022 Logan Fick
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
import com.vdurmont.emoji.Emoji;
|
||||
import com.vdurmont.emoji.EmojiManager;
|
||||
|
||||
import net.dv8tion.jda.core.utils.Checks;
|
||||
import net.dv8tion.jda.internal.utils.Checks;
|
||||
|
||||
public final class StringUtil {
|
||||
private StringUtil() {
|
||||
|
||||
@@ -1,30 +1,23 @@
|
||||
package dev.logal.logalbot.utils;
|
||||
|
||||
// Copyright 2019 Logan Fick
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import java.util.List;
|
||||
/*
|
||||
* Copyright 2022 Logan Fick
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
import com.sedmelluq.discord.lavaplayer.track.AudioTrack;
|
||||
import com.sedmelluq.discord.lavaplayer.track.AudioTrackInfo;
|
||||
|
||||
import dev.logal.logalbot.audio.RequestedTrack;
|
||||
import net.dv8tion.jda.core.EmbedBuilder;
|
||||
import net.dv8tion.jda.core.entities.Guild;
|
||||
import net.dv8tion.jda.core.entities.MessageEmbed;
|
||||
import net.dv8tion.jda.core.entities.User;
|
||||
import net.dv8tion.jda.core.utils.Checks;
|
||||
import net.dv8tion.jda.api.EmbedBuilder;
|
||||
import net.dv8tion.jda.api.entities.Guild;
|
||||
import net.dv8tion.jda.api.entities.MessageEmbed;
|
||||
import net.dv8tion.jda.api.entities.User;
|
||||
import net.dv8tion.jda.internal.utils.Checks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public final class TrackUtil {
|
||||
private TrackUtil() {
|
||||
|
||||
@@ -1,22 +1,16 @@
|
||||
package dev.logal.logalbot.utils;
|
||||
|
||||
// Copyright 2019 Logan Fick
|
||||
/*
|
||||
* Copyright 2022 Logan Fick
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import net.dv8tion.jda.core.entities.Member;
|
||||
import net.dv8tion.jda.core.entities.VoiceChannel;
|
||||
import net.dv8tion.jda.core.utils.Checks;
|
||||
import net.dv8tion.jda.api.entities.Member;
|
||||
import net.dv8tion.jda.api.entities.channel.concrete.VoiceChannel;
|
||||
import net.dv8tion.jda.internal.utils.Checks;
|
||||
|
||||
public final class VoiceChannelUtil {
|
||||
private VoiceChannelUtil() {
|
||||
|
||||
Reference in New Issue
Block a user