Skip to content

Commit

Permalink
revert everything done in the last ~45 minutes
Browse files Browse the repository at this point in the history
  • Loading branch information
uncreativeCultist committed Jul 11, 2024
1 parent da67ddc commit 1c336ff
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@ public void doCommand(CommandEvent event)
String args = event.getArgs().startsWith("<") && event.getArgs().endsWith(">")
? event.getArgs().substring(1,event.getArgs().length()-1)
: event.getArgs().isEmpty() ? event.getMessage().getAttachments().get(0).getUrl() : event.getArgs();
if (args == event.getMessage().getAttachments().get(0).getUrl() && bot.getConfig().getPiped() != null && args.contains(bot.getConfig().getPiped())) {
args.replace(bot.getConfig().getPiped(), "youtube.com");
}
event.reply(loadingEmoji+" Loading... `["+args+"]`", m -> bot.getPlayerManager().loadItemOrdered(event.getGuild(), args, new ResultHandler(m,event,false)));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,6 @@ public void doCommand(CommandEvent event)
String args = event.getArgs().startsWith("<") && event.getArgs().endsWith(">")
? event.getArgs().substring(1,event.getArgs().length()-1)
: event.getArgs().isEmpty() ? event.getMessage().getAttachments().get(0).getUrl() : event.getArgs();
if (args == event.getMessage().getAttachments().get(0).getUrl() && bot.getConfig().getPiped() != null && args.contains(bot.getConfig().getPiped())) {
args.replace(bot.getConfig().getPiped(), "youtube.com");
}
event.reply(loadingEmoji+" Loading... `["+args+"]`", m -> bot.getPlayerManager().loadItemOrdered(event.getGuild(), args, new ResultHandler(m,event,false)));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ protected void execute(CommandEvent event)
.append("\n Owner = ").append(bot.getConfig().getOwnerId())
.append("\n Prefix = ").append(bot.getConfig().getPrefix())
.append("\n AltPrefix = ").append(bot.getConfig().getAltPrefix())
.append("\n PipedURL = ").append(bot.getConfig().getPiped())
.append("\n MaxSeconds = ").append(bot.getConfig().getMaxSeconds())
.append("\n NPImages = ").append(bot.getConfig().useNPImages())
.append("\n SongInStatus = ").append(bot.getConfig().getSongInStatus())
Expand Down
37 changes: 0 additions & 37 deletions src/main/java/com/jagrosh/jmusicbot/utils/OtherUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -223,41 +223,4 @@ public static String getUnsupportedBotReason(JDA jda)
ApplicationInfo info = jda.retrieveApplicationInfo().complete();
return null;
}

public static boolean isPipedInstance(String url)
{
try
{
Response response = new OkHttpClient.Builder().build()
.newCall(new Request.Builder().get().url(url + "/trending").build())
.execute();
ResponseBody body = response.body();
if(body != null)
{
try(Reader reader = body.charStream())
{
JSONObject obj = new JSONObject(new JSONTokener(reader));
try {
if (obj.getString("error") == "region is a required parameter") {
return true;
}
return false;
}
catch (Exception e) {
return false;
}
}
finally
{
response.close();
}
}
else
return false;
}
catch(IOException | JSONException | NullPointerException ex)
{
return false;
}
}
}
7 changes: 0 additions & 7 deletions src/main/resources/reference.conf
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,6 @@ songinstatus=false

altprefix = "NONE"

// If you set this, the bot will play streams from this Piped instance
// Depending on your server location, this may perform better than default youtube.
// For more information on Piped, check out the project page here: https://github.com/TeamPiped/Piped
// For a list of Piped instances and their URLs, check the wiki: https://github.com/TeamPiped/Piped/wiki/Instances

pipedURL = "NONE"


// If you set these, it will change the various emojis

Expand Down

0 comments on commit 1c336ff

Please sign in to comment.