Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
aee076c
add more sources
jagrosh Sep 3, 2022
2faef67
Merge branch 'master' of https://github.com/jagrosh/MusicBot
jagrosh Sep 3, 2022
2d4f267
Don't warn about failing to load server settings when the file isn't …
MichailiK Feb 28, 2024
90d9a16
Create a new serversettings.json file if one doesn't exist
MichailiK Feb 28, 2024
ff1ede9
Log "loaded config" message again after successfully initializing the…
MichailiK Feb 28, 2024
781a94e
Merge branch 'master' of https://github.com/jagrosh/MusicBot
jagrosh Mar 1, 2024
fa5e33e
fix formatting and nulls in metadata
jagrosh Mar 1, 2024
a521036
update version
jagrosh Mar 1, 2024
c5ecf89
switch to java 11
jagrosh Mar 1, 2024
4f926ba
update circleci settings
jagrosh Mar 1, 2024
ac8661c
Merge pull request #1487 from MichailiK/fix/server-settings-logging
jagrosh Mar 1, 2024
4c8ff65
update github actions to jdk 11
jagrosh Mar 1, 2024
fd6de60
Merge pull request #1489 from jagrosh/add-more-sources
jagrosh Mar 2, 2024
18bf6ac
Remove channel topic info (#1485)
MichailiK Mar 2, 2024
23c2dfa
Make JMusicBot error & shut down if ran in an unsupported manner (#1486)
MichailiK Mar 2, 2024
8a1066c
Allow configurable default skip ratio (#1140)
t3rminus Mar 2, 2024
bb53bad
Update test.yml
jagrosh Mar 2, 2024
1ad1618
Support new Discord username (#1397)
MagicTeaMC Mar 3, 2024
2e9dd5d
add LinearQueue (#1194)
Woife5 Mar 4, 2024
a7807b9
Always self-deafen (#1491)
MichailiK Mar 5, 2024
bb17c98
Codefactor Fixes (#1493)
jagrosh Mar 5, 2024
6752695
rename github action file and update readme (#1494)
jagrosh Mar 5, 2024
49c3ec7
Switch to lavalink's lavaplayer fork (#1490)
MichailiK Mar 5, 2024
801b376
Fix startup message type and add URL to message (#1521)
jagrosh Mar 30, 2024
b3ffbdb
Add log level configuration (#1156)
MichailiK Mar 30, 2024
81322ef
Add seek command (supersedes #344) (#674)
MichailiK May 10, 2024
0afb3db
Switch to lavalink's new YouTube audio source manager (#1552)
MichailiK May 10, 2024
6f12c33
custom eval engine (#1530)
jagrosh May 10, 2024
48e62f1
Revert "Always self-deafen (#1491)" (#1551)
MichailiK May 10, 2024
8557f7a
Log track exceptions in the audio handler (#1558)
MichailiK May 10, 2024
6a5a9c7
Change playlist page count (#1542)
jagrosh May 10, 2024
e5fd05e
Update dependencies to fix youtube issues (#1609)
Morilli Jul 10, 2024
8733899
Update bug-report.yml
jagrosh Jul 10, 2024
f140b41
Use shell comparsion (#1627)
TimothyGillespie Aug 1, 2024
e6bfd18
fix error when playing (#1632)
kokofixcomputers Aug 1, 2024
eca2563
fix npe and an import (#1567)
jagrosh Aug 1, 2024
43b63f1
fixed a mistake (#1648)
nezjusz Aug 6, 2024
859e5c5
Update lavaplayer youtube source to 1.5.2 (#1655)
MichailiK Aug 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
build:
docker:
# specify the version you desire here
- image: circleci/openjdk:8u171-jdk
- image: cimg/openjdk:11.0

# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
Expand Down
9 changes: 8 additions & 1 deletion .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,12 @@ body:
required: true
- label: I have searched for similar issues [on the issues page](https://github.com/jagrosh/MusicBot/issues?q=is%3Aissue)
required: true
- label: "I am running the latest version of the bot: ![Release](https://img.shields.io/github/release/jagrosh/MusicBot.svg)"
- label: I am using an official release from [the releases page](https://github.com/jagrosh/MusicBot/releases)
required: true
- type: input
id: version
attributes:
label: JMusicBot Version
description: Which version of JMusicBot are you running?
validations:
required: true
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
name: Test
name: Build and Test
on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 8
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '8'
java-version: '11'
distribution: 'adopt'
cache: maven
- name: Build with Maven
- name: Build and Test with Maven
run: mvn --batch-mode --update-snapshots verify
4 changes: 2 additions & 2 deletions .github/workflows/make-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up JDK 8
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '8'
java-version: '11'
distribution: 'adopt'
cache: maven
- name: Set Version
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
[![Release](https://img.shields.io/github/release/jagrosh/MusicBot.svg)](https://github.com/jagrosh/MusicBot/releases/latest)
[![License](https://img.shields.io/github/license/jagrosh/MusicBot.svg)](https://github.com/jagrosh/MusicBot/blob/master/LICENSE)
[![Discord](https://discordapp.com/api/guilds/147698382092238848/widget.png)](https://discord.gg/0p9LSGoRLu6Pet0k)<br>
[![CircleCI](https://img.shields.io/circleci/project/github/jagrosh/MusicBot/master.svg)](https://circleci.com/gh/jagrosh/MusicBot)
[![AppVeyor](https://ci.appveyor.com/api/projects/status/gdu6nyte5psj6xfk/branch/master?svg=true)](https://ci.appveyor.com/project/jagrosh/musicbot/branch/master)
[![CircleCI](https://dl.circleci.com/status-badge/img/gh/jagrosh/MusicBot/tree/master.svg?style=svg)](https://dl.circleci.com/status-badge/redirect/gh/jagrosh/MusicBot/tree/master)
[![Build and Test](https://github.com/jagrosh/MusicBot/actions/workflows/build-and-test.yml/badge.svg)](https://github.com/jagrosh/MusicBot/actions/workflows/build-and-test.yml)
[![CodeFactor](https://www.codefactor.io/repository/github/jagrosh/musicbot/badge)](https://www.codefactor.io/repository/github/jagrosh/musicbot)

A cross-platform Discord music bot with a clean interface, and that is easy to set up and run yourself!
Expand Down
42 changes: 25 additions & 17 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
<repository>
<id>m2.duncte123.dev</id>
<name>m2-duncte123</name>
<url>https://m2.duncte123.dev/releases</url>
</repository>
<repository>
<id>arbjergDev</id>
<name>Lavalink Repository</name>
<url>https://maven.lavalink.dev/releases</url>
</repository>
</repositories>

<dependencies>
Expand All @@ -42,28 +52,26 @@
</dependency>

<!-- Music Dependencies -->
<!-- using a fork of this to fix some issues faster -->
<!-- dependency>
<groupId>com.sedmelluq</groupId>
<dependency>
<groupId>dev.arbjerg</groupId>
<artifactId>lavaplayer</artifactId>
<version>1.3.78</version>
</dependency -->
<version>2.2.1</version>
</dependency>
<dependency>
<groupId>com.github.jagrosh</groupId>
<artifactId>lavaplayer</artifactId>
<version>jmusicbot-SNAPSHOT</version>
</dependency>
<!-- this is needed, but isn't actually hosted anywhere anymore... uh -->
<!--dependency>
<groupId>com.sedmelluq</groupId>
<artifactId>lavaplayer-natives-extra</artifactId>
<version>1.3.13</version>
</dependency-->
<groupId>dev.lavalink.youtube</groupId>
<artifactId>common</artifactId>
<version>1.5.2</version>
</dependency>
<dependency>
<groupId>com.github.jagrosh</groupId>
<artifactId>JLyrics</artifactId>
<version>master-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.dunctebot</groupId>
<artifactId>sourcemanagers</artifactId>
<version>1.9.0</version>
</dependency>

<!-- Misc Internal Dependencies -->
<dependency>
Expand Down Expand Up @@ -141,7 +149,7 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
</properties>
</project>
4 changes: 2 additions & 2 deletions scripts/run_jmusicbot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ DOWNLOAD=true
LOOP=true

download() {
if [ $DOWNLOAD == true ]; then
if [ $DOWNLOAD = true ]; then
URL=$(curl -s https://api.github.com/repos/jagrosh/MusicBot/releases/latest \
| grep -i browser_download_url.*\.jar \
| grep -i "browser_download_url.*\.jar" \
| sed 's/.*\(http.*\)"/\1/')
FILENAME=$(echo $URL | sed 's/.*\/\([^\/]*\)/\1/')
if [ -f $FILENAME ]; then
Expand Down
1 change: 0 additions & 1 deletion src/main/java/com/jagrosh/jmusicbot/Bot.java
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ public void shutdown()
{
ah.stopAndClear();
ah.getPlayer().destroy();
nowplaying.updateTopic(g.getIdLong(), ah, true);
}
});
jda.shutdown();
Expand Down
42 changes: 37 additions & 5 deletions src/main/java/com/jagrosh/jmusicbot/BotConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
package com.jagrosh.jmusicbot;

import com.jagrosh.jmusicbot.entities.Prompt;
import com.jagrosh.jmusicbot.utils.FormatUtil;
import com.jagrosh.jmusicbot.utils.OtherUtil;
import com.jagrosh.jmusicbot.utils.TimeUtil;
import com.sedmelluq.discord.lavaplayer.track.AudioTrack;
import com.typesafe.config.*;
import java.io.IOException;
Expand All @@ -39,10 +39,13 @@ public class BotConfig
private final static String END_TOKEN = "/// END OF JMUSICBOT CONFIG ///";

private Path path = null;
private String token, prefix, altprefix, helpWord, playlistsFolder,
successEmoji, warningEmoji, errorEmoji, loadingEmoji, searchingEmoji;
private String token, prefix, altprefix, helpWord, playlistsFolder, logLevel,
successEmoji, warningEmoji, errorEmoji, loadingEmoji, searchingEmoji,
evalEngine;
private boolean stayInChannel, songInGame, npImages, updatealerts, useEval, dbots;
private long owner, maxSeconds, aloneTimeUntilStop;
private int maxYTPlaylistPages;
private double skipratio;
private OnlineStatus status;
private Activity game;
private Config aliases, transforms;
Expand Down Expand Up @@ -85,12 +88,16 @@ public void load()
songInGame = config.getBoolean("songinstatus");
npImages = config.getBoolean("npimages");
updatealerts = config.getBoolean("updatealerts");
logLevel = config.getString("loglevel");
useEval = config.getBoolean("eval");
evalEngine = config.getString("evalengine");
maxSeconds = config.getLong("maxtime");
maxYTPlaylistPages = config.getInt("maxytplaylistpages");
aloneTimeUntilStop = config.getLong("alonetimeuntilstop");
playlistsFolder = config.getString("playlistsfolder");
aliases = config.getConfig("aliases");
transforms = config.getConfig("transforms");
skipratio = config.getDouble("skipratio");
dbots = owner == 113156185389092864L;

// we may need to write a new config file
Expand Down Expand Up @@ -231,6 +238,11 @@ public String getToken()
return token;
}

public double getSkipRatio()
{
return skipratio;
}

public long getOwnerId()
{
return owner;
Expand Down Expand Up @@ -266,6 +278,11 @@ public Activity getGame()
return game;
}

public boolean isGameNone()
{
return game != null && game.getName().equalsIgnoreCase("none");
}

public OnlineStatus getStatus()
{
return status;
Expand Down Expand Up @@ -300,12 +317,22 @@ public boolean useUpdateAlerts()
{
return updatealerts;
}


public String getLogLevel()
{
return logLevel;
}

public boolean useEval()
{
return useEval;
}

public String getEvalEngine()
{
return evalEngine;
}

public boolean useNPImages()
{
return npImages;
Expand All @@ -316,9 +343,14 @@ public long getMaxSeconds()
return maxSeconds;
}

public int getMaxYTPlaylistPages()
{
return maxYTPlaylistPages;
}

public String getMaxTime()
{
return FormatUtil.formatTime(maxSeconds * 1000);
return TimeUtil.formatTime(maxSeconds * 1000);
}

public long getAloneTimeUntilStop()
Expand Down
Loading