Skip to content

Commit

Permalink
Stupid feature, it's disabled (for now)
Browse files Browse the repository at this point in the history
  • Loading branch information
duncte123 committed Nov 25, 2017
1 parent 218d715 commit 0524c43
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions src/main/java/ml/duncte123/skybot/BotListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -223,19 +223,20 @@ public void onGuildMemberJoin(GuildMemberJoinEvent event) {
*/
@Override
public void onGuildJoin(GuildJoinEvent event) {
//Temp disable that
//if 60 of a guild is bots, we'll leave it
double[] botToUserRatio = AirUtils.getBotRatio(event.getGuild());
if (botToUserRatio[1] > 60) {
AirUtils.getPublicChannel(event.getGuild()).sendMessage(String.format("Hey %s, %s%s of this guild are bots (%s is the total btw). Iḿ outta here.",
event.getGuild().getOwner().getAsMention(),
botToUserRatio[1],
"%",
event.getGuild().getMemberCache().size())).queue(
message -> message.getGuild().leave().queue()
);
AirUtils.log(Settings.defaultName + "GuildJoin", Level.INFO, "Joining guild: " + event.getGuild().getName() + ", and leaving it after. BOT ALERT");
return;
}
// double[] botToUserRatio = AirUtils.getBotRatio(event.getGuild());
// if (botToUserRatio[1] > 60) {
// AirUtils.getPublicChannel(event.getGuild()).sendMessage(String.format("Hey %s, %s%s of this guild are bots (%s is the total btw). Iḿ outta here.",
// event.getGuild().getOwner().getAsMention(),
// botToUserRatio[1],
// "%",
// event.getGuild().getMemberCache().size())).queue(
// message -> message.getGuild().leave().queue()
// );
// AirUtils.log(Settings.defaultName + "GuildJoin", Level.INFO, "Joining guild: " + event.getGuild().getName() + ", and leaving it after. BOT ALERT");
// return;
// }
AirUtils.log(Settings.defaultName + "GuildJoin", Level.INFO, "Joining guild: " + event.getGuild().getName() + ".");
GuildSettingsUtils.registerNewGuild(event.getGuild());
AirUtils.updateGuildCount(event.getJDA(), event.getJDA().asBot().getShardManager().getGuildCache().size());
Expand Down

0 comments on commit 0524c43

Please sign in to comment.