Skip to content

Commit

Permalink
Merge branch 'master' into fixYoutube
Browse files Browse the repository at this point in the history
  • Loading branch information
Sartharon committed Mar 12, 2024
2 parents 1083808 + 49c3ec7 commit ccc09f9
Show file tree
Hide file tree
Showing 36 changed files with 694 additions and 296 deletions.
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
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
6 changes: 3 additions & 3 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 All @@ -17,7 +17,7 @@ A cross-platform Discord music bot with a clean interface, and that is easy to s
* Fix 403 error during loading of YouTube songs/videos
* ~~Add PAPISID and PSID token support allowing playback of age restricted videos (Consult the [documentation](https://github.com/Sartharon/MusicBot/blob/gh-pages/docs/youtube-age-restrictions.md) on how to get these tokens)~~
* Use Google account to play age restricted songs/videos (Consult [example config](https://github.com/Sartharon/MusicBot/blob/fixYoutube/src/main/resources/reference.conf) - Variables: YoutubeEmail/YoutubePassword)
* Update LavaPlayer to an actively maintained [fork](https://github.com/Walkyst/lavaplayer-fork)
* Update LavaPlayer to an actively maintained [fork](https://github.com/lavalink-devs/lavaplayer)

[![Setup](http://i.imgur.com/VvXYp5j.png)](https://jmusicbot.com/setup)

Expand Down
51 changes: 27 additions & 24 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.jagrosh</groupId>
<artifactId>JMusicBot</artifactId>
<version>0.3.9</version>
<version>0.4.0</version>
<packaging>jar</packaging>

<repositories>
Expand All @@ -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-snapshots</id>
<name>Lavalink Repository</name>
<url>https://maven.lavalink.dev/snapshots</url>
</repository>
</repositories>

<dependencies>
Expand All @@ -42,34 +52,27 @@
</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.1.1</version>
</dependency>
<dependency>
<groupId>com.github.jagrosh</groupId>
<artifactId>JLyrics</artifactId>
<version>master-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.github.Walkyst</groupId>
<artifactId>lavaplayer-fork</artifactId>
<version>1.4.3</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-->
<dependency>
<groupId>com.github.jagrosh</groupId>
<artifactId>JLyrics</artifactId>
<version>master-SNAPSHOT</version>
</dependency>
<groupId>com.dunctebot</groupId>
<artifactId>sourcemanagers</artifactId>
<version>1.9.0</version>
</dependency>

<!-- Misc Internal Dependencies -->
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.2.10</version>
<version>1.2.13</version>
</dependency>
<dependency>
<groupId>com.typesafe</groupId>
Expand Down Expand Up @@ -141,7 +144,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>
2 changes: 1 addition & 1 deletion scripts/run_jmusicbot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ LOOP=true
download() {
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
12 changes: 12 additions & 0 deletions src/main/java/com/jagrosh/jmusicbot/BotConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public class BotConfig
successEmoji, warningEmoji, errorEmoji, loadingEmoji, searchingEmoji, YoutubeEmail, YoutubePwd;
private boolean stayInChannel, songInGame, npImages, updatealerts, useEval, dbots;
private long owner, maxSeconds, aloneTimeUntilStop;
private double skipratio;
private OnlineStatus status;
private Activity game;
private Config aliases, transforms;
Expand Down Expand Up @@ -93,6 +94,7 @@ public void load()
transforms = config.getConfig("transforms");
YoutubeEmail = config.getString("YoutubeEmail");
YoutubePwd = config.getString("YoutubePassword");
skipratio = config.getDouble("skipratio");
dbots = owner == 113156185389092864L;

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

public double getSkipRatio()
{
return skipratio;
}

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

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

public OnlineStatus getStatus()
{
return status;
Expand Down
Loading

0 comments on commit ccc09f9

Please sign in to comment.