Removed the whole Rethink stuff
This commit is contained in:
parent
818833e4d4
commit
7eccebba9a
5 changed files with 2 additions and 71 deletions
5
pom.xml
5
pom.xml
|
|
@ -32,11 +32,6 @@
|
||||||
</repository>
|
</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
|
||||||
<groupId>com.rethinkdb</groupId>
|
|
||||||
<artifactId>rethinkdb-driver</artifactId>
|
|
||||||
<version>LATEST</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.dv8tion</groupId>
|
<groupId>net.dv8tion</groupId>
|
||||||
<artifactId>JDA</artifactId>
|
<artifactId>JDA</artifactId>
|
||||||
|
|
|
||||||
|
|
@ -1,31 +0,0 @@
|
||||||
package discord.data.mining;
|
|
||||||
|
|
||||||
import com.rethinkdb.net.Connection;
|
|
||||||
|
|
||||||
import static com.rethinkdb.RethinkDB.r;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Hax
|
|
||||||
* @github github.com/Schlauer-Hax
|
|
||||||
* @time 19:40 07.08.2018
|
|
||||||
* @project Discord-Data-Mining
|
|
||||||
* @package discord.data.mining
|
|
||||||
* @class Database
|
|
||||||
**/
|
|
||||||
|
|
||||||
public class Database {
|
|
||||||
|
|
||||||
static Connection conn;
|
|
||||||
|
|
||||||
public static void connect() {
|
|
||||||
conn = r.connection()
|
|
||||||
.hostname("localhost")
|
|
||||||
.db("DM")
|
|
||||||
.port(28015)
|
|
||||||
.connect();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Connection getConn() {
|
|
||||||
return conn;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -17,7 +17,7 @@ public class MessageReceivedListener extends ListenerAdapter {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onMessageReceived(MessageReceivedEvent event) {
|
public void onMessageReceived(MessageReceivedEvent event) {
|
||||||
if (event.getAuthor().getId().contains("401817301919465482") || event.getAuthor().getId().contains("261083609148948488")) {
|
if (event.getAuthor().getId().contains("477141528981012511") || event.getAuthor().getId().contains("261083609148948488")) {
|
||||||
if (event.getMessage().getContentRaw().equals("dm!shutdown") || (event.getMessage().getContentRaw().equals("dm!stop"))) {
|
if (event.getMessage().getContentRaw().equals("dm!shutdown") || (event.getMessage().getContentRaw().equals("dm!stop"))) {
|
||||||
|
|
||||||
for (JDA Bots : Main.bots) {
|
for (JDA Bots : Main.bots) {
|
||||||
|
|
|
||||||
|
|
@ -21,14 +21,13 @@ public class Main {
|
||||||
public static ArrayList<JDA> clients = new ArrayList<>();
|
public static ArrayList<JDA> clients = new ArrayList<>();
|
||||||
public static ArrayList<JDA> bots = new ArrayList<>();
|
public static ArrayList<JDA> bots = new ArrayList<>();
|
||||||
public static ArrayList<JDA> manager = new ArrayList<>();
|
public static ArrayList<JDA> manager = new ArrayList<>();
|
||||||
public static int currentBot =0;
|
public static int currentBot = 0;
|
||||||
public static ArrayList<String> onlineclients = new ArrayList<>();
|
public static ArrayList<String> onlineclients = new ArrayList<>();
|
||||||
public static long Actionperh = 0;
|
public static long Actionperh = 0;
|
||||||
public static ArrayList<Guild> guilds = new ArrayList<>();
|
public static ArrayList<Guild> guilds = new ArrayList<>();
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
try {
|
try {
|
||||||
Database.connect();
|
|
||||||
for (String Token : managerTokens) {
|
for (String Token : managerTokens) {
|
||||||
manager.add(new JDABuilder(AccountType.BOT).setAutoReconnect(true).setToken(Token).addEventListeners(new MessageReceivedListener()).build());
|
manager.add(new JDABuilder(AccountType.BOT).setAutoReconnect(true).setToken(Token).addEventListeners(new MessageReceivedListener()).build());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,11 +16,7 @@ import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
|
||||||
import net.dv8tion.jda.api.events.message.react.MessageReactionAddEvent;
|
import net.dv8tion.jda.api.events.message.react.MessageReactionAddEvent;
|
||||||
import net.dv8tion.jda.api.events.message.react.MessageReactionRemoveEvent;
|
import net.dv8tion.jda.api.events.message.react.MessageReactionRemoveEvent;
|
||||||
|
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.util.Calendar;
|
|
||||||
|
|
||||||
import static com.rethinkdb.RethinkDB.r;
|
|
||||||
|
|
||||||
public class sendMessage {
|
public class sendMessage {
|
||||||
public static void sendMessage(Event inputevent) {
|
public static void sendMessage(Event inputevent) {
|
||||||
|
|
@ -31,16 +27,6 @@ public class sendMessage {
|
||||||
if (inputevent instanceof MessageReceivedEvent) {
|
if (inputevent instanceof MessageReceivedEvent) {
|
||||||
MessageReceivedEvent event = (MessageReceivedEvent) inputevent;
|
MessageReceivedEvent event = (MessageReceivedEvent) inputevent;
|
||||||
if (!event.getGuild().getId().equals("448554629282922527")) {
|
if (!event.getGuild().getId().equals("448554629282922527")) {
|
||||||
Calendar cal = Calendar.getInstance();
|
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
|
|
||||||
String time = sdf.format(cal.getTime());
|
|
||||||
r.table("messages").insert(
|
|
||||||
r.hashMap("MessageID", event.getMessage().getIdLong())
|
|
||||||
.with("AuthorID", event.getAuthor().getIdLong())
|
|
||||||
.with("GuildID", event.getGuild().getIdLong())
|
|
||||||
.with("Content", event.getMessage().getContentRaw())
|
|
||||||
.with("Time", time)
|
|
||||||
).run(Database.getConn());
|
|
||||||
BOT.getTextChannelById(Main.MessageLog)
|
BOT.getTextChannelById(Main.MessageLog)
|
||||||
.sendMessage(
|
.sendMessage(
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
|
|
@ -60,24 +46,6 @@ public class sendMessage {
|
||||||
} else if (inputevent instanceof MessageReactionAddEvent) {
|
} else if (inputevent instanceof MessageReactionAddEvent) {
|
||||||
MessageReactionAddEvent event = (MessageReactionAddEvent) inputevent;
|
MessageReactionAddEvent event = (MessageReactionAddEvent) inputevent;
|
||||||
if (!event.getGuild().getId().equals("448554629282922527")) {
|
if (!event.getGuild().getId().equals("448554629282922527")) {
|
||||||
Calendar cal = Calendar.getInstance();
|
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
|
|
||||||
String time = sdf.format(cal.getTime());
|
|
||||||
event.getTextChannel().getMessageById(event.getMessageId()).queue(
|
|
||||||
msg -> {
|
|
||||||
StringBuilder reactions = new StringBuilder();
|
|
||||||
msg.getReactions().forEach(messageReaction -> reactions.append(messageReaction.getReactionEmote().getName()+" ("+messageReaction.getCount()+")"));
|
|
||||||
r.table("reactionadd").insert(
|
|
||||||
r.hashMap("MessageID", msg.getIdLong())
|
|
||||||
.with("AuthorID", msg.getIdLong())
|
|
||||||
.with("GuildID", event.getGuild().getIdLong())
|
|
||||||
.with("Content", msg.getContentRaw())
|
|
||||||
.with("Time", time)
|
|
||||||
.with("NewReaction", event.getReaction().getReactionEmote().getName())
|
|
||||||
.with("Reactions", reactions.toString())
|
|
||||||
).run(Database.getConn());
|
|
||||||
}
|
|
||||||
);
|
|
||||||
BOT.getTextChannelById(Main.ReactionLog)
|
BOT.getTextChannelById(Main.ReactionLog)
|
||||||
.sendMessage(
|
.sendMessage(
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue