File tree Expand file tree Collapse file tree 4 files changed +16
-4
lines changed
src/main/java/com/jagrosh/vortex Expand file tree Collapse file tree 4 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -287,8 +287,10 @@ public void leavePointlessGuilds()
287287 return false ;
288288 if (Constants .OWNER_ID .equals (g .getOwnerId ()))
289289 return false ;
290- int botcount = (int )g .getMemberCache ().stream ().filter (m -> m .getUser ().isBot ()).count ();
291- if (g .getMemberCache ().size ()-botcount <15 || (botcount >20 && ((double )botcount /g .getMemberCache ().size ())>0.5 ))
290+ int botcount = (int ) g .getMemberCache ().stream ().filter (m -> m .getUser ().isBot ()).count ();
291+ int totalcount = (int ) g .getMemberCache ().size ();
292+ int humancount = totalcount - botcount ;
293+ if (humancount < 30 || botcount > humancount )
292294 {
293295 if (database .settings .hasSettings (g ))
294296 return false ;
Original file line number Diff line number Diff line change @@ -58,7 +58,8 @@ protected void execute(CommandEvent event)
5858 .put ("tempmutes" , db .tempmutes .getAllMutesJson (g ))
5959 .put ("tempbans" , db .tempbans .getAllBansJson (g ))
6060 .put ("inviteWhitelist" , db .inviteWhitelist .getWhitelistJson (g ))
61- .put ("filters" , db .filters .getFiltersJson (g ));
61+ .put ("filters" , db .filters .getFiltersJson (g ))
62+ .put ("premium" , db .premium .getPremiumInfoJson (g ));
6263 event .getChannel ().sendFile (obj .toString (1 ).getBytes (), "vortex_data_" + g .getId () + ".json" ).queue ();
6364 }
6465}
Original file line number Diff line number Diff line change @@ -137,7 +137,7 @@ public JSONArray getWhitelistJson(Guild guild)
137137 {
138138 List <Long > list = readWhitelist (guild );
139139 JSONArray arr = new JSONArray ();
140- list .forEach (id -> list . add (id ));
140+ list .forEach (id -> arr . put (id ));
141141 return arr ;
142142 }
143143
Original file line number Diff line number Diff line change 3030import java .util .LinkedList ;
3131import java .util .List ;
3232import net .dv8tion .jda .core .entities .Guild ;
33+ import org .json .JSONObject ;
3334
3435/**
3536 *
@@ -72,6 +73,14 @@ public PremiumInfo getPremiumInfo(Guild guild)
7273 });
7374 }
7475
76+ public JSONObject getPremiumInfoJson (Guild guild )
77+ {
78+ PremiumInfo info = getPremiumInfo (guild );
79+ return new JSONObject ()
80+ .put ("level" , info .level .name ())
81+ .put ("until" , info .until == null ? 0 : info .until .getEpochSecond ());
82+ }
83+
7584 public void addPremiumForever (Guild guild , Level level )
7685 {
7786 readWrite (selectAll (GUILD_ID .is (guild .getIdLong ())), rs ->
You can’t perform that action at this time.
0 commit comments