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

Commit bfbdac2

Browse files
authored
Merge branch 'master' into Hax
2 parents 3fdc56b + 538a7be commit bfbdac2

File tree

7 files changed

+95
-10
lines changed

7 files changed

+95
-10
lines changed

GBideen.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
GottBotReloaded ideen
22

33
- 1 Handler mit Owner überprüfung, Language Handler, Menu handler, MySQL Handler, (commandHandler?), usw
4-
- Better language integration/Handler
5-
- Sharding?
4+
- Music Command
65
- commandRegisterHandler damit man nicht so viele zeilen nur für commandRegistering braucht
7-
- games
6+
- games

pom.xml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,5 +96,29 @@
9696
<artifactId>ftpserver-core</artifactId>
9797
<version>LATEST</version>
9898
</dependency>
99+
100+
<dependency>
101+
<groupId>com.google.api-client</groupId>
102+
<artifactId>google-api-client</artifactId>
103+
<version>1.23.0</version>
104+
</dependency>
105+
106+
<dependency>
107+
<groupId>com.google.oauth-client</groupId>
108+
<artifactId>google-oauth-client-jetty</artifactId>
109+
<version>1.23.0</version>
110+
</dependency>
111+
112+
<dependency>
113+
<groupId>com.google.apis</groupId>
114+
<artifactId>google-api-services-youtube</artifactId>
115+
<version>v3-rev191-1.23.0</version>
116+
</dependency>
117+
118+
<dependency>
119+
<groupId>com.google.api-client</groupId>
120+
<artifactId>google-api-client-appengine</artifactId>
121+
<version>1.23.0</version>
122+
</dependency>
99123
</dependencies>
100124
</project>
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
package commands.music;
2+
3+
import commands.Command;
4+
import net.dv8tion.jda.core.events.message.MessageReceivedEvent;
5+
import net.dv8tion.jda.core.exceptions.PermissionException;
6+
7+
public class CommandJoin implements Command {
8+
@Override
9+
public boolean called(String[] args, MessageReceivedEvent event) {
10+
return false;
11+
}
12+
13+
@Override
14+
public void action(String[] args, MessageReceivedEvent event) {
15+
try {
16+
if (!event.getGuild().getAudioManager().isConnected() && !event.getGuild().getAudioManager().isAttemptingToConnect()) {
17+
if (event.getGuild().getAudioManager().getGuild().getVoiceChannels().contains(event.getMember().getVoiceState().getChannel())) {
18+
event.getGuild().getAudioManager().openAudioConnection(event.getMember().getVoiceState().getChannel());
19+
} else {
20+
event.getTextChannel().sendMessage("unknown error (eigentlich nicht)").queue();
21+
}
22+
} else {
23+
event.getTextChannel().sendMessage("I am already connected!").queue();
24+
}
25+
} catch (PermissionException e) {
26+
27+
}
28+
event.getGuild().getAudioManager().setSelfDeafened(true);
29+
}
30+
31+
@Override
32+
public void executed(boolean success, MessageReceivedEvent event) {
33+
34+
}
35+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package commands.music;
2+
3+
import commands.Command;
4+
import net.dv8tion.jda.core.events.message.MessageReceivedEvent;
5+
6+
public class CommandLeave implements Command {
7+
@Override
8+
public boolean called(String[] args, MessageReceivedEvent event) {
9+
return false;
10+
}
11+
12+
@Override
13+
public void action(String[] args, MessageReceivedEvent event) {
14+
if (event.getGuild().getAudioManager().isConnected() || event.getGuild().getAudioManager().isAttemptingToConnect()) {
15+
event.getGuild().getAudioManager().closeAudioConnection();
16+
} else {
17+
event.getTextChannel().sendMessage("I cant leave when i am not in a voice channel").queue();
18+
}
19+
}
20+
21+
@Override
22+
public void executed(boolean success, MessageReceivedEvent event) {
23+
24+
}
25+
}

src/main/java/commands/tools/CommandProfile.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import java.util.ResourceBundle;
1818

1919
import static core.JSONhandler.readJsonFromUrl;
20+
import static javax.print.attribute.standard.Chromaticity.COLOR;
2021

2122
public class CommandProfile implements Command {
2223
String Nick;

src/main/java/core/Main.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22

33
import commands.botowner.*;
44
import commands.moderation.*;
5+
import commands.music.CommandJoin;
56
import commands.tools.*;
67
import commands.usercommands.*;
78
import commands.usercommands.CommandHelp;
89
import commands.botowner.CommandInfo;
910
import commands.usercommands.CommandPremium;
1011
import listener.*;
12+
import music.AudioCore;
1113
import net.dv8tion.jda.bot.sharding.DefaultShardManagerBuilder;
1214
import net.dv8tion.jda.bot.sharding.ShardManager;
1315
import net.dv8tion.jda.core.JDA;
@@ -29,6 +31,7 @@ public class Main {
2931
public static boolean dev = true;
3032
public static SessionController sessionController;
3133
public static ShardManager shardManager;
34+
public static AudioCore audioCore;
3235

3336
public static void main(String[] args2) {
3437
try {
@@ -84,7 +87,7 @@ public static void main(String[] args2) {
8487
commandHandler.commands.put("setxp", new CommandSetXP());
8588
commandHandler.commands.put("clyde", new CommandClyde());
8689
commandHandler.commands.put("ping", new CommandPing());
87-
commandHandler.commands.put("leave", new CommandLeave());
90+
commandHandler.commands.put("guildleave", new CommandLeave());
8891
commandHandler.commands.put("stats", new CommandStats());
8992
commandHandler.commands.put("verification", new CommandVerification());
9093
commandHandler.commands.put("say", new CommandSay());
@@ -107,6 +110,9 @@ public static void main(String[] args2) {
107110
commandHandler.commands.put("shard", new CommandShard());
108111
commandHandler.commands.put("uptime", new CommandUptime());
109112
commandHandler.commands.put("role", new CommandRole());
113+
/*MUSIC*/
114+
commandHandler.commands.put("join", new CommandJoin());
115+
commandHandler.commands.put("leave", new commands.music.CommandLeave());
110116
args = args2;
111117
logger.info("loaded all commands");
112118
logger.info("Starting the Bot...");

target/classes/MessagesBundle_de.properties

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
#Helpmenu
32
Helpmenu.helpmenu=Helpmenu
43
Helpmenu.helpmenu.description=Please react with the Emotes. Use the :arrow_backward: or the :back: emoji to see the overview
@@ -136,7 +135,6 @@ util.none=none
136135
util.mine=You don't have enough Hashes... Mine! %extra%
137136
util.bbnguild=Please use this command on the official BigBotNetwork Server: %extra%
138137
util.nopermissionuser=You have no Permission to use this
139-
<<<<<<< HEAD
140138
util.nopermissionbot=I have no permission to do this
141139
#botowner
142140
botowner.test.title=Erfolgreich
@@ -154,7 +152,4 @@ botowner.setlvl.text=Erfolgreich Level gesetzt
154152
botowner.setxp.title=Erfolgreich
155153
botowner.setxp.text=Erfolgreich XP gesetzt
156154
botowner.leave.title=Erfolgreich
157-
botowner.leave.text=Erfolgreich den Server %extra% verlassen
158-
=======
159-
util.nopermissionbot=I have no permission to do this
160-
>>>>>>> 3c136e0338f156d8787b69dfb3a9ae18657881d5
155+
botowner.leave.text=Erfolgreich den Server %extra% verlassen

0 commit comments

Comments
 (0)