Skip to content
This repository has been archived by the owner on Oct 28, 2021. It is now read-only.

Commit

Permalink
Merge pull request #107 from BigBotNetwork/Greg
Browse files Browse the repository at this point in the history
d
  • Loading branch information
greg6775 authored Apr 15, 2018
2 parents e63c384 + 4ff396f commit 4a5effc
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 78 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
<dependency>
<groupId>com.sedmelluq</groupId>
<artifactId>lavaplayer</artifactId>
<version>1.2.56</version>
<version>1.2.34</version>
</dependency>
<dependency>
<groupId>com.github.taycaldwell</groupId>
Expand Down
12 changes: 10 additions & 2 deletions src/main/java/commands/moderation/CommandBan.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public boolean called(String[] args, MessageReceivedEvent event) {
public void action(String[] args, MessageReceivedEvent event) {
if (event.getAuthor().getId() == event.getGuild().getOwner().getUser().getId() || event.getMember().hasPermission(Permission.BAN_MEMBERS) || Owner.get(event.getAuthor())) {
Message msg = event.getMessage();

if (msg.getMentionedUsers().size()== 0) {
event.getTextChannel().sendMessage(MessageHandler.getEmbed("moderation.ban.title", "moderation.ban.text", "", "normal", event)).queue();
} else {
Expand All @@ -33,8 +34,15 @@ public void action(String[] args, MessageReceivedEvent event) {
PrivateChannel channel = User.getUser().openPrivateChannel().complete();
channel.sendMessage(MessageHandler.getEmbed("moderation.ban.ban", "moderation.ban.user", event.getGuild().getName(), "sucess", event)).queue();
}
msg.getGuild().getController().ban(User, 1).queue();
event.getTextChannel().sendMessage(MessageHandler.getEmbed("moderation.ban.ban", "moderation.ban.channel", User.getUser().getName(), "sucess", event)).queue();
if (args.length > 0) {
String reason = event.getMessage().getContentRaw().replaceFirst(MessageHandler.getprefix(event.getGuild()), "").replaceFirst("ban", "").replaceFirst(args[0], "");
msg.getGuild().getController().ban(User, 1).reason(reason).queue();
event.getTextChannel().sendMessage(MessageHandler.getEmbed("moderation.ban.ban", "moderation.ban.channel", User.getUser().getName(), "sucess", event)).queue();
} else {
msg.getGuild().getController().ban(User, 1).queue();
event.getTextChannel().sendMessage(MessageHandler.getEmbed("moderation.ban.ban", "moderation.ban.channel", User.getUser().getName(), "sucess", event)).queue();
}

}
}
} else {
Expand Down
35 changes: 0 additions & 35 deletions src/main/java/commands/music/CommandJoin.java

This file was deleted.

25 changes: 0 additions & 25 deletions src/main/java/commands/music/CommandLeave.java

This file was deleted.

8 changes: 4 additions & 4 deletions src/main/java/commands/tools/CommandBotInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ public void action(String[] args, MessageReceivedEvent event) {

JsonObject jsonObject = new JsonParser().parse(requestResponse.getResponseMessage()).getAsJsonObject();
event.getTextChannel().sendMessage(jsonObject.toString()).queue();
event.getTextChannel().sendMessage(new EmbedBuilder().setThumbnail(jsonObject.get("avatar").getAsString()).setTitle("Botinfo: " + jsonObject.get("name").getAsString()).build()).queue();
event.getTextChannel().sendMessage(new EmbedBuilder().setThumbnail(jsonObject.get("avatar").getAsString())
.setTitle("Botinfo: " + jsonObject.get("name").getAsString())
.addField("Owner", "jisdjisdjijsdij " + jsonObject.get("username"), true)
.build()).queue();

} catch (IOException e) {
e.printStackTrace();
Expand All @@ -49,9 +52,6 @@ public void action(String[] args, MessageReceivedEvent event) {

}




} else {
event.getTextChannel().sendMessage("Zu kurz!").queue();
}
Expand Down
1 change: 0 additions & 1 deletion src/main/java/commands/tools/CommandUpvoted.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ public void action(String[] args, MessageReceivedEvent event) {

List<String> voters = api.getVoterIds("407189087649398795", 1);


if (event.getMessage().getGuild().getId().equals(BBN)) {
if (voters.contains(u.getId())) {

Expand Down
15 changes: 5 additions & 10 deletions src/main/java/core/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,15 @@

import commands.botowner.*;
import commands.moderation.*;
import commands.music.CommandJoin;
import commands.tools.*;
import commands.usercommands.*;
import commands.usercommands.CommandHelp;
import commands.botowner.CommandInfo;
import commands.usercommands.CommandPremium;
import listener.*;
import music.AudioCore;
import net.dv8tion.jda.bot.sharding.DefaultShardManagerBuilder;
import net.dv8tion.jda.bot.sharding.ShardManager;
import net.dv8tion.jda.core.JDA;
import net.dv8tion.jda.core.entities.Game;
import net.dv8tion.jda.core.utils.SessionController;
import org.apache.commons.net.ftp.FTPClient;
import org.slf4j.Logger;
Expand All @@ -31,7 +28,6 @@ public class Main {
public static boolean dev = true;
public static SessionController sessionController;
public static ShardManager shardManager;
public static AudioCore audioCore;

public static void main(String[] args2) {
try {
Expand Down Expand Up @@ -82,7 +78,7 @@ public static void main(String[] args2) {
commandHandler.commands.put("ban", new CommandBan());
commandHandler.commands.put("kick", new CommandKick());
commandHandler.commands.put("github", new CommandGitHub());
commandHandler.commands.put("stop", new CommandStop());
commandHandler.commands.put("botstop", new CommandStop());
commandHandler.commands.put("setlvl", new CommandSetLevel());
commandHandler.commands.put("setxp", new CommandSetXP());
commandHandler.commands.put("clyde", new CommandClyde());
Expand All @@ -96,11 +92,11 @@ public static void main(String[] args2) {
commandHandler.commands.put("levelmessage", new CommandLevelMessage());
commandHandler.commands.put("guild", new CommandGuild());
commandHandler.commands.put("help", new CommandHelp());
commandHandler.commands.put("info", new CommandInfo());
commandHandler.commands.put("about", new CommandInfo());
commandHandler.commands.put("warn", new CommandWarn());
commandHandler.commands.put("token", new CommandToken());
commandHandler.commands.put("log", new CommandLog());
commandHandler.commands.put("play", new CommandPlay());
commandHandler.commands.put("game-play", new CommandPlay());
commandHandler.commands.put("dm", new CommandDM());
commandHandler.commands.put("miner", new CommandMiner());
commandHandler.commands.put("premium", new CommandPremium());
Expand All @@ -111,9 +107,8 @@ public static void main(String[] args2) {
commandHandler.commands.put("uptime", new CommandUptime());
commandHandler.commands.put("role", new CommandRole());
commandHandler.commands.put("botinfo", new CommandBotInfo());
/*MUSIC*/
commandHandler.commands.put("join", new CommandJoin());
commandHandler.commands.put("leave", new commands.music.CommandLeave());
commandHandler.commands.put("upvoted", new CommandUpvoted());

args = args2;
logger.info("loaded all commands");
logger.info("Starting the Bot...");
Expand Down
9 changes: 9 additions & 0 deletions src/main/java/util/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ public class Constants {
progBars.put(names[i], ids[i]);
}
}
public static String argsToString(String[] args, String filler){
String out = "";
for (String s : args){
if (out != "")
out += filler;
out += s;
}
return out;
}


}

0 comments on commit 4a5effc

Please sign in to comment.