Merge Greg's branch into the master branch #293
6 changed files with 32 additions and 11 deletions
|
|
@ -99,7 +99,7 @@ public class Hadder {
|
|||
new EditRulesCommand(),
|
||||
new VolumeCommand(),
|
||||
new StopCommand(),
|
||||
new BlackListCommand()), config, helpCommand);
|
||||
new BlacklistCommand()), config, helpCommand);
|
||||
|
||||
builder.addEventListeners(
|
||||
new MentionListener(rethink),
|
||||
|
|
|
|||
|
|
@ -164,8 +164,8 @@ public class Rethink {
|
|||
return !this.get("server", "id", guild_id, "starboard").equals("");
|
||||
}
|
||||
|
||||
public void insertStarboardMessage(String message_id, String guild_id, String starboardmessageid) {
|
||||
this.insert("stars", r.hashMap("id", message_id).with("guild", guild_id).with("starboardmsg", starboardmessageid));
|
||||
public void insertStarboardMessage(String message_id, String guild_id, String starboard_message_id) {
|
||||
this.insert("stars", r.hashMap("id", message_id).with("guild", guild_id).with("starboardmsg", starboard_message_id));
|
||||
}
|
||||
|
||||
public String getStarboardMessage(String message_id) {
|
||||
|
|
|
|||
|
|
@ -1,15 +1,14 @@
|
|||
package com.bbn.hadder.commands.owner;
|
||||
|
||||
/*
|
||||
* @author Hax / Hax6775 / Schlauer_Hax
|
||||
*/
|
||||
|
||||
package com.bbn.hadder.commands.owner;
|
||||
|
||||
import com.bbn.hadder.commands.Command;
|
||||
import com.bbn.hadder.commands.CommandEvent;
|
||||
import com.bbn.hadder.core.Perm;
|
||||
import com.bbn.hadder.core.Perms;
|
||||
import com.bbn.hadder.utils.MessageEditor;
|
||||
import net.dv8tion.jda.api.EmbedBuilder;
|
||||
import net.dv8tion.jda.api.entities.Member;
|
||||
import net.dv8tion.jda.api.entities.User;
|
||||
|
||||
|
|
@ -19,7 +18,7 @@ import java.util.LinkedHashSet;
|
|||
import java.util.List;
|
||||
|
||||
@Perms(Perm.BOT_OWNER)
|
||||
public class BlackListCommand implements Command {
|
||||
public class BlacklistCommand implements Command {
|
||||
|
||||
@Override
|
||||
public void executed(String[] args, CommandEvent event) {
|
||||
|
|
@ -71,7 +70,7 @@ public class BlackListCommand implements Command {
|
|||
if (!user.getId().equals(event.getJDA().getSelfUser().getId())) {
|
||||
String blacklisted = event.getRethink().getBlackListed(user.getId());
|
||||
if (!blacklisted.equals("none")) {
|
||||
stringBuilder.append(user.getAsTag() + " (" + user.getId() + ") - " + blacklisted + "\n");
|
||||
stringBuilder.append(user.getAsTag()).append(" (").append(user.getId()).append(") - ").append(blacklisted).append("\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -92,16 +91,16 @@ public class BlackListCommand implements Command {
|
|||
|
||||
@Override
|
||||
public String description() {
|
||||
return null;
|
||||
return "commands.owner.blacklist.help.description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String usage() {
|
||||
return "add|remove|list Commands @Skidder#6775";
|
||||
return "add|remove|list command @User";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String example() {
|
||||
return null;
|
||||
return "add porn @Skidder";
|
||||
}
|
||||
}
|
||||
|
|
@ -143,6 +143,10 @@ public class Config {
|
|||
return config.getJSONObject("Tokens").getString("BotListSpace");
|
||||
}
|
||||
|
||||
public String getDiscordBots2Token() {
|
||||
return config.getJSONObject("Tokens").getString("DiscordBots2");
|
||||
}
|
||||
|
||||
public String getClydeName() {
|
||||
return config.getString("Clyde");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ public class BotList {
|
|||
private static String DiscordBotReviews = "https://discordbotreviews.xyz/api/bot/637002314162372639/stats";
|
||||
private static String DiscordBots = "https://top.gg/api/bots/637002314162372639/stats";
|
||||
private static String BotListSpace = "https://api.botlist.space/v1/bots/637002314162372639";
|
||||
private static String DiscordBots2 = "https://discord.bots.gg/api/v1/bots/637002314162372639/stats";
|
||||
|
||||
private Config config;
|
||||
|
||||
|
|
@ -43,6 +44,7 @@ public class BotList {
|
|||
json.put("guilds", Hadder.shardManager.getGuilds().size());
|
||||
json.put("users", Hadder.shardManager.getUsers().size());
|
||||
json.put("shard_count", Hadder.shardManager.getShards().size());
|
||||
json.put("shardCount", Hadder.shardManager.getShards().size());
|
||||
|
||||
RequestBody body = RequestBody.create(MediaType.parse("application/json"), json.toString());
|
||||
|
||||
|
|
@ -195,6 +197,21 @@ public class BotList {
|
|||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
// Discord Bots 2
|
||||
|
||||
Request discordbots2 = new Request.Builder()
|
||||
.url(DiscordBots2)
|
||||
.post(body)
|
||||
.addHeader("Authorization", config.getDiscordBots2Token())
|
||||
.build();
|
||||
|
||||
try {
|
||||
new OkHttpClient().newCall(discordbots2).execute().close();
|
||||
System.out.println("Successfully posted count to discord.bots.gg!");
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -247,6 +247,7 @@ commands.owner.shutdown.success.title = Shutdown
|
|||
commands.owner.shutdown.help.description = Shuts the Bot down
|
||||
commands.owner.test.success = TEST my friends
|
||||
commands.owner.test.help.description = Just a little Test Command
|
||||
commands.owner.blacklist.help.description = Blacklist a user for specific commands
|
||||
|
||||
commands.settings.language.success.title = Language set
|
||||
commands.settings.language.success.description = `%extra%` is your new language now.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue