Compare commits
2 Commits
2656266a57
...
c28a476682
Author | SHA1 | Date | |
---|---|---|---|
|
c28a476682 | ||
239d89e42a |
9
.github/workflows/build.yml
vendored
9
.github/workflows/build.yml
vendored
@ -17,10 +17,10 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Set up JDK 17
|
||||
- name: Set up JDK 1.8
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: 17
|
||||
java-version: 1.8
|
||||
|
||||
- name: Grant execute permission for gradlew
|
||||
run: chmod +x gradlew
|
||||
@ -35,9 +35,8 @@ jobs:
|
||||
path: build/libs/
|
||||
|
||||
build-docker:
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- build-gradle
|
||||
runs-on: [ ubuntu-latest ]
|
||||
needs: [ build-gradle ]
|
||||
if: github.ref == 'refs/heads/master'
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
@ -1,4 +1,4 @@
|
||||
FROM openjdk:17.0.2
|
||||
FROM openjdk:8-jre-buster
|
||||
WORKDIR /bot_src
|
||||
ARG BUILD_NBR
|
||||
ARG BRANCH_NAME
|
||||
@ -6,5 +6,7 @@ ARG BRANCH_NAME
|
||||
ARG GITHUB_RUN_NUMBER
|
||||
ADD build/libs/ClaptrapBot-*.jar /bot_src/bot.jar
|
||||
RUN java -version
|
||||
CMD java -jar bot.jar
|
||||
ENV PORT=8080
|
||||
ENV TOKEN=10
|
||||
CMD java -jar bot.jar -t ${TOKEN}
|
||||
LABEL org.opencontainers.image.source=https://github.com/Sebclem/ClaptrapBot/
|
17
build.gradle
17
build.gradle
@ -15,15 +15,26 @@ version = "$versionObj"
|
||||
sourceCompatibility = '17'
|
||||
|
||||
|
||||
|
||||
|
||||
jar.doFirst {
|
||||
delete "${buildDir}/libs/*"
|
||||
}
|
||||
|
||||
jar {
|
||||
// delete "${buildDir}/libs/*"
|
||||
// baseName = 'DiscordBot'
|
||||
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
jcenter()
|
||||
maven {
|
||||
url 'https://m2.dv8tion.net/releases'
|
||||
}
|
||||
}
|
||||
jar{
|
||||
enabled(false)
|
||||
}
|
||||
|
||||
|
||||
dependencies {
|
||||
implementation("org.springframework.boot:spring-boot-starter-web"){
|
||||
|
@ -55,20 +55,42 @@ public class Music implements SlashCommand {
|
||||
event.getHook().sendMessage(message).queue();
|
||||
}
|
||||
break;
|
||||
case "add":
|
||||
OptionMapping url = event.getOption("url");
|
||||
boolean next = false;
|
||||
if(event.getOption("next") != null){
|
||||
next = event.getOption("next").getAsBoolean();
|
||||
}
|
||||
if(event.getOption("playlist-limit") == null){
|
||||
audio.add(event, url.getAsString(),30, next);
|
||||
}
|
||||
else{
|
||||
long limit = event.getOption("playlist-limit").getAsLong();
|
||||
audio.add(event, url.getAsString(), (int) limit, next);
|
||||
}
|
||||
break;
|
||||
// case "add":
|
||||
// event.getTextChannel().sendTyping().queue();
|
||||
// if(args.length ==2){
|
||||
// audio.add(event,args[1],30,false);
|
||||
// }
|
||||
// else if(args.length == 3){
|
||||
// try{
|
||||
// int limit = Integer.parseInt(args[2]);
|
||||
// audio.add(event,args[1],limit,false);
|
||||
// }catch (NumberFormatException e){
|
||||
// audio.add(event,args[1],30,false);
|
||||
// }
|
||||
// }
|
||||
// else{
|
||||
// Message message = event.getTextChannel().sendMessage(EmbedMessageUtils.getMusicError("Missing argument!")).complete();
|
||||
// List<Message> messages = new ArrayList<Message>(){{
|
||||
// add(message);
|
||||
// add(event.getMessage());
|
||||
// }};
|
||||
// new MessageTimeOut(messages, MainBot.messageTimeOut).start();
|
||||
// }
|
||||
// break;
|
||||
// case "addNext":
|
||||
// event.getTextChannel().sendTyping().queue();
|
||||
// if(args.length >=2){
|
||||
// audio.add(event,args[1],1,true);
|
||||
// }
|
||||
// else{
|
||||
// Message message = event.getTextChannel().sendMessage(EmbedMessageUtils.getMusicError("Missing argument!")).complete();
|
||||
// List<Message> messages = new ArrayList<Message>(){{
|
||||
// add(message);
|
||||
// add(event.getMessage());
|
||||
// }};
|
||||
// new MessageTimeOut(messages, MainBot.messageTimeOut).start();
|
||||
// }
|
||||
// break;
|
||||
case "pause":
|
||||
audio.pause(event);
|
||||
break;
|
||||
@ -92,6 +114,8 @@ public class Music implements SlashCommand {
|
||||
audio.list(event);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -107,13 +131,11 @@ public class Music implements SlashCommand {
|
||||
@Override
|
||||
public List<SubcommandData> getSubcommands() {
|
||||
ArrayList<SubcommandData> subCommandList = new ArrayList<>();
|
||||
subCommandList.add(new SubcommandData("play", "Play music")
|
||||
subCommandList.add(new SubcommandData("play", "Play somme music")
|
||||
.addOption(OptionType.STRING, "url", "The URL of the video to play", true)
|
||||
.addOption(OptionType.INTEGER, "playlist-limit", "If a playlist is loaded, enter the max number of loaded tracks (default to 30)"));
|
||||
subCommandList.add(new SubcommandData("add", "Add track to queue")
|
||||
.addOption(OptionType.STRING, "url", " The URL of the video to play", true)
|
||||
.addOption(OptionType.BOOLEAN, "next", "If true, track will be added on top of the playlist and will be the next to play")
|
||||
.addOption(OptionType.INTEGER, "playlist-limit", "If a playlist is loaded, enter the max number of loaded tracks (default to 30)"));
|
||||
.addOption(OptionType.INTEGER, "playlist-limit", "If a playlist is loaded, enter the max number of loaded tracks"));
|
||||
subCommandList.add(new SubcommandData("add", "Add music to queue")
|
||||
.addOption(OptionType.STRING, "url", " The URL of the video to play", true));
|
||||
subCommandList.add(new SubcommandData("pause", "Pause playback"));
|
||||
subCommandList.add(new SubcommandData("resume", "Resume playback"));
|
||||
subCommandList.add(new SubcommandData("stop", "Stop playback"));
|
||||
|
Loading…
Reference in New Issue
Block a user