Skip to content

Commit

Permalink
Make login optional (default off). New config entry useYTLogin=false
Browse files Browse the repository at this point in the history
  • Loading branch information
ErdbeerbaerLP committed Nov 27, 2024
1 parent 94682c7 commit 04ce19e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/java/com/jagrosh/jmusicbot/BotConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public class BotConfig
private String token, prefix, altprefix, helpWord, playlistsFolder, logLevel,
successEmoji, warningEmoji, errorEmoji, loadingEmoji, searchingEmoji,
evalEngine;
private boolean stayInChannel, songInGame, npImages, updatealerts, useEval, dbots;
private boolean stayInChannel, songInGame, npImages, updatealerts, useEval, dbots, useYTLogin;
private long owner, maxSeconds, aloneTimeUntilStop;
private int maxYTPlaylistPages;
private double skipratio;
Expand Down Expand Up @@ -104,6 +104,7 @@ public void load()
aliases = config.getConfig("aliases");
transforms = config.getConfig("transforms");
skipratio = config.getDouble("skipratio");
useYTLogin = config.getBoolean("useYTLogin");
dbots = owner == 113156185389092864L;

// we may need to write a new config file
Expand Down Expand Up @@ -399,4 +400,7 @@ public Config getTransforms()
public boolean isSpotifyEnabled() {
return !getSpotifyClientID().isEmpty() && !getSpotifyClientSecret().isEmpty();
}
public boolean isOAUTHEnabled() {
return useYTLogin;
}
}
3 changes: 3 additions & 0 deletions src/main/resources/reference.conf
Original file line number Diff line number Diff line change
Expand Up @@ -230,4 +230,7 @@ evalengine="Nashorn"
spotifyclientid = "";
spotifyclientsecret = "";

// Should the bot use an burner account? If true, requires OAUTH2 login, see console output for instructions.
// Might bypass issues, but can also cause new ones. Don't use your main yt account!!
useYTLogin=false
/// END OF JMUSICBOT CONFIG ///

0 comments on commit 04ce19e

Please sign in to comment.