Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -24,13 +24,8 @@ public class CommandE6 extends Command
|
||||
@Override
|
||||
public void onRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
||||
{
|
||||
if(guild.contentRating == KittyRating.Filtered || !guild.channels.get(Long.getLong(channel.uniqueID)).mature)
|
||||
if(guild.contentRating == KittyRating.Filtered)
|
||||
{
|
||||
if(!guild.channels.get(Long.getLong(channel.uniqueID)).mature)
|
||||
{
|
||||
res.send("This channel is SFW only! Have some (probably) wholesome content ^^~");
|
||||
}
|
||||
|
||||
image = searcher.getE6(input.args + " rating:safe");
|
||||
try
|
||||
{
|
||||
@@ -43,7 +38,7 @@ public class CommandE6 extends Command
|
||||
}
|
||||
try
|
||||
{
|
||||
if(response.authorText == null)
|
||||
if(response.bodyImageURL == null)
|
||||
{
|
||||
Exception e = new Exception();
|
||||
throw e;
|
||||
|
||||
@@ -77,15 +77,20 @@ public class NetworkE6
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
for(int i = 0; i < imageObj.length; ++i)
|
||||
{
|
||||
String [] TagsList = imageObj[i].tags.split(" ");
|
||||
blacklisted = false;
|
||||
for(int j = 0; j < blacklist.length; j++)
|
||||
{
|
||||
if(imageObj[i].tags.contains(blacklist[j]))
|
||||
for(int k = 0; k < TagsList.length; k ++)
|
||||
{
|
||||
System.out.println("BLACKLISTED " + blacklist[j]);
|
||||
blacklisted = true;
|
||||
if(TagsList[k].equals(blacklist[j]))
|
||||
{
|
||||
System.out.println("BLACKLISTED " + blacklist[j]);
|
||||
blacklisted = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import utils.HTTPUtils;
|
||||
public class NetworkSauceNAO
|
||||
{
|
||||
private static final Gson jsonParser_ = new Gson();
|
||||
private static final String API_ROOT = "https://saucenao.com/search.php?db=999&output_type=2&numres=10&api_key=" + Ref.SauceNAOKey +"&url=";
|
||||
private static final String API_ROOT = "https://saucenao.com/search.php?dbmask=268435456&output_type=2&numres=10&api_key=" + Ref.SauceNAOKey +"&url=";
|
||||
NetworkE6 e6Sauce = new NetworkE6();
|
||||
private class SauceNAOResponseObject
|
||||
{
|
||||
@@ -40,6 +40,7 @@ public class NetworkSauceNAO
|
||||
if(sauceUrl.startsWith("https://e621.net/post/show/"))
|
||||
{
|
||||
System.out.println("id:" + sauceUrl.substring(26));
|
||||
System.out.println("HERE");
|
||||
return e6Sauce.getE6("id:" + sauceUrl.substring(27)).toString();
|
||||
}
|
||||
return sauce.results.get(0).data.ext_urls[0];
|
||||
|
||||
Reference in New Issue
Block a user