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

Commit 4a5effc

Browse files
authoredApr 15, 2018
Merge pull request #107 from BigBotNetwork/Greg
d
2 parents e63c384 + 4ff396f commit 4a5effc

File tree

8 files changed

+29
-78
lines changed

8 files changed

+29
-78
lines changed
 

‎pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
<dependency>
8080
<groupId>com.sedmelluq</groupId>
8181
<artifactId>lavaplayer</artifactId>
82-
<version>1.2.56</version>
82+
<version>1.2.34</version>
8383
</dependency>
8484
<dependency>
8585
<groupId>com.github.taycaldwell</groupId>

‎src/main/java/commands/moderation/CommandBan.java

+10-2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ public boolean called(String[] args, MessageReceivedEvent event) {
2222
public void action(String[] args, MessageReceivedEvent event) {
2323
if (event.getAuthor().getId() == event.getGuild().getOwner().getUser().getId() || event.getMember().hasPermission(Permission.BAN_MEMBERS) || Owner.get(event.getAuthor())) {
2424
Message msg = event.getMessage();
25+
2526
if (msg.getMentionedUsers().size()== 0) {
2627
event.getTextChannel().sendMessage(MessageHandler.getEmbed("moderation.ban.title", "moderation.ban.text", "", "normal", event)).queue();
2728
} else {
@@ -33,8 +34,15 @@ public void action(String[] args, MessageReceivedEvent event) {
3334
PrivateChannel channel = User.getUser().openPrivateChannel().complete();
3435
channel.sendMessage(MessageHandler.getEmbed("moderation.ban.ban", "moderation.ban.user", event.getGuild().getName(), "sucess", event)).queue();
3536
}
36-
msg.getGuild().getController().ban(User, 1).queue();
37-
event.getTextChannel().sendMessage(MessageHandler.getEmbed("moderation.ban.ban", "moderation.ban.channel", User.getUser().getName(), "sucess", event)).queue();
37+
if (args.length > 0) {
38+
String reason = event.getMessage().getContentRaw().replaceFirst(MessageHandler.getprefix(event.getGuild()), "").replaceFirst("ban", "").replaceFirst(args[0], "");
39+
msg.getGuild().getController().ban(User, 1).reason(reason).queue();
40+
event.getTextChannel().sendMessage(MessageHandler.getEmbed("moderation.ban.ban", "moderation.ban.channel", User.getUser().getName(), "sucess", event)).queue();
41+
} else {
42+
msg.getGuild().getController().ban(User, 1).queue();
43+
event.getTextChannel().sendMessage(MessageHandler.getEmbed("moderation.ban.ban", "moderation.ban.channel", User.getUser().getName(), "sucess", event)).queue();
44+
}
45+
3846
}
3947
}
4048
} else {

‎src/main/java/commands/music/CommandJoin.java

-35
This file was deleted.

‎src/main/java/commands/music/CommandLeave.java

-25
This file was deleted.

‎src/main/java/commands/tools/CommandBotInfo.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ public void action(String[] args, MessageReceivedEvent event) {
2929

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

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

5053
}
5154

52-
53-
54-
5555
} else {
5656
event.getTextChannel().sendMessage("Zu kurz!").queue();
5757
}

‎src/main/java/commands/tools/CommandUpvoted.java

-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ public void action(String[] args, MessageReceivedEvent event) {
3434

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

37-
3837
if (event.getMessage().getGuild().getId().equals(BBN)) {
3938
if (voters.contains(u.getId())) {
4039

‎src/main/java/core/Main.java

+5-10
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,15 @@
22

33
import commands.botowner.*;
44
import commands.moderation.*;
5-
import commands.music.CommandJoin;
65
import commands.tools.*;
76
import commands.usercommands.*;
87
import commands.usercommands.CommandHelp;
98
import commands.botowner.CommandInfo;
109
import commands.usercommands.CommandPremium;
1110
import listener.*;
12-
import music.AudioCore;
1311
import net.dv8tion.jda.bot.sharding.DefaultShardManagerBuilder;
1412
import net.dv8tion.jda.bot.sharding.ShardManager;
1513
import net.dv8tion.jda.core.JDA;
16-
import net.dv8tion.jda.core.entities.Game;
1714
import net.dv8tion.jda.core.utils.SessionController;
1815
import org.apache.commons.net.ftp.FTPClient;
1916
import org.slf4j.Logger;
@@ -31,7 +28,6 @@ public class Main {
3128
public static boolean dev = true;
3229
public static SessionController sessionController;
3330
public static ShardManager shardManager;
34-
public static AudioCore audioCore;
3531

3632
public static void main(String[] args2) {
3733
try {
@@ -82,7 +78,7 @@ public static void main(String[] args2) {
8278
commandHandler.commands.put("ban", new CommandBan());
8379
commandHandler.commands.put("kick", new CommandKick());
8480
commandHandler.commands.put("github", new CommandGitHub());
85-
commandHandler.commands.put("stop", new CommandStop());
81+
commandHandler.commands.put("botstop", new CommandStop());
8682
commandHandler.commands.put("setlvl", new CommandSetLevel());
8783
commandHandler.commands.put("setxp", new CommandSetXP());
8884
commandHandler.commands.put("clyde", new CommandClyde());
@@ -96,11 +92,11 @@ public static void main(String[] args2) {
9692
commandHandler.commands.put("levelmessage", new CommandLevelMessage());
9793
commandHandler.commands.put("guild", new CommandGuild());
9894
commandHandler.commands.put("help", new CommandHelp());
99-
commandHandler.commands.put("info", new CommandInfo());
95+
commandHandler.commands.put("about", new CommandInfo());
10096
commandHandler.commands.put("warn", new CommandWarn());
10197
commandHandler.commands.put("token", new CommandToken());
10298
commandHandler.commands.put("log", new CommandLog());
103-
commandHandler.commands.put("play", new CommandPlay());
99+
commandHandler.commands.put("game-play", new CommandPlay());
104100
commandHandler.commands.put("dm", new CommandDM());
105101
commandHandler.commands.put("miner", new CommandMiner());
106102
commandHandler.commands.put("premium", new CommandPremium());
@@ -111,9 +107,8 @@ public static void main(String[] args2) {
111107
commandHandler.commands.put("uptime", new CommandUptime());
112108
commandHandler.commands.put("role", new CommandRole());
113109
commandHandler.commands.put("botinfo", new CommandBotInfo());
114-
/*MUSIC*/
115-
commandHandler.commands.put("join", new CommandJoin());
116-
commandHandler.commands.put("leave", new commands.music.CommandLeave());
110+
commandHandler.commands.put("upvoted", new CommandUpvoted());
111+
117112
args = args2;
118113
logger.info("loaded all commands");
119114
logger.info("Starting the Bot...");

‎src/main/java/util/Constants.java

+9
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,15 @@ public class Constants {
1515
progBars.put(names[i], ids[i]);
1616
}
1717
}
18+
public static String argsToString(String[] args, String filler){
19+
String out = "";
20+
for (String s : args){
21+
if (out != "")
22+
out += filler;
23+
out += s;
24+
}
25+
return out;
26+
}
1827

1928

2029
}

0 commit comments

Comments
 (0)
This repository has been archived.