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

Commit

Permalink
Merge pull request #21 from zekroTJA/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
ゼクロ authored Jul 13, 2017
2 parents a538429 + 4b0e399 commit 42834b9
Show file tree
Hide file tree
Showing 66 changed files with 956 additions and 270 deletions.
4 changes: 2 additions & 2 deletions SETTINGS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# GENERAL SERVER SETTINGS #

# Enter here your Discord API Token you'll get from here: https://discordapp.com/developers/applications/me
TOKEN = "Mjg3NTM4NDM1NjU1MjA0ODY0.DCppvg.lNnxUM-y_P7kSaRhmVZlevQ5m3I"
TOKEN = "Mjg3NTM4NDM1NjU1MjA0ODY0.DD0qvg.XN0l_ZRmwnl3uixRq5Vonrp3OMo"
# Prefix to send bot commands (like -help or ~help or .help, what ever you want)
CMD_PREFIX = "."

Expand All @@ -16,7 +16,7 @@
# Log entered command in console of the bot
COMMAND_CONSOLE_OUTPUT = true
# Automatically check for updates
AUTO_UPDATE = false
UPDATE_INFO = false
# Only allow members to use music commands in music channel
MUSIC_COMMANDS_ONLY_IN_MUSIC_CHANNEL = false
# Volume in percent (0 - 100, 0 -> Disabled -> 100% volume)
Expand Down
119 changes: 0 additions & 119 deletions install.py

This file was deleted.

Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions src/main/java/commands/Command.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ public interface Command {
String help();
String description();
String commandType();
int permission();
}

7 changes: 6 additions & 1 deletion src/main/java/commands/administration/Broadcast.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,16 @@ public String help() {

@Override
public String description() {
return null;
return "Send a message to all servers general chats";
}

@Override
public String commandType() {
return STATICS.CMDTYPE.etc;
}

@Override
public int permission() {
return 3;
}
}
14 changes: 11 additions & 3 deletions src/main/java/commands/administration/Guilds.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

import java.io.IOException;
import java.text.ParseException;
import java.util.Comparator;

/**
* Created by zekro on 11.06.2017 / 11:02
Expand Down Expand Up @@ -56,8 +57,10 @@ public void action(String[] args, MessageReceivedEvent event) throws ParseExcept
StringBuilder sb = new StringBuilder();

sb.append("**Running on `" + event.getJDA().getGuilds().size() + "` guilds.**\n\n");
event.getJDA().getGuilds().forEach(g -> sb.append(
":white_small_square: **" + g.getName() + "** - `" + g.getId() + "` - " + g.getOwner().getAsMention() + "\n"
event.getJDA().getGuilds().stream()
.sorted(Comparator.comparingInt(s -> s.getMembers().size()))
.forEach(g -> sb.append(
":white_small_square: *[" + g.getMembers().size() + "]* - **" + g.getName() + "** - `" + g.getId() + "` - " + g.getOwner().getEffectiveName() + "\n"
));

event.getTextChannel().sendMessage(new EmbedBuilder().setTitle("Guilds", null).setDescription(sb.toString()).build()).queue();
Expand All @@ -76,11 +79,16 @@ public String help() {

@Override
public String description() {
return null;
return "Get list of guilds bot is running on";
}

@Override
public String commandType() {
return STATICS.CMDTYPE.administration;
}

@Override
public int permission() {
return 3;
}
}
7 changes: 6 additions & 1 deletion src/main/java/commands/administration/Restart.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public void action(String[] args, MessageReceivedEvent event) throws ParseExcept
event.getTextChannel().sendMessage(":warning: Bot will restart now...").queue();

if (System.getProperty("os.name").toLowerCase().contains("linux"))
Runtime.getRuntime().exec("sudo screen sudo python restart.py");
Runtime.getRuntime().exec("screen sudo python restart.py");
else
Runtime.getRuntime().exec("wincmd.exe -restart");

Expand All @@ -62,4 +62,9 @@ public String description() {
public String commandType() {
return STATICS.CMDTYPE.administration;
}

@Override
public int permission() {
return 3;
}
}
20 changes: 18 additions & 2 deletions src/main/java/commands/administration/Stop.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
package commands.administration;

import commands.Command;
import commands.etc.BotStats;
import core.Perms;
import core.coreCommands;
import net.dv8tion.jda.core.events.message.MessageReceivedEvent;
import utils.STATICS;

import java.io.IOException;
import java.text.ParseException;
import java.util.Timer;
import java.util.TimerTask;

/**
* Created by zekro on 23.03.2017 / 21:13
Expand All @@ -27,8 +30,16 @@ public void action(String[] args, MessageReceivedEvent event) throws ParseExcept

if (!Perms.isOwner(event.getAuthor(), event.getTextChannel())) return;

event.getTextChannel().sendMessage(":warning: :mobile_phone_off: " + event.getAuthor().getAsMention() + " shut down " + event.getJDA().getSelfUser().getAsMention() + " because of maintenance or an unexpected behavior.").queue();
System.exit(0);
BotStats.save();

//event.getTextChannel().sendMessage(":warning: :mobile_phone_off: " + event.getAuthor().getAsMention() + " shut down " + event.getJDA().getSelfUser().getAsMention() + " because of maintenance or an unexpected behavior.").queue();
new Timer().schedule(new TimerTask() {
@Override
public void run() {
System.exit(0);
}
}, 1000);

}

@Override
Expand All @@ -50,4 +61,9 @@ public String description() {
public String commandType() {
return STATICS.CMDTYPE.administration;
}

@Override
public int permission() {
return 3;
}
}
14 changes: 6 additions & 8 deletions src/main/java/commands/administration/Update.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,7 @@ public void action(String[] args, MessageReceivedEvent event) throws ParseExcept

if (!Perms.isOwner(event.getAuthor(), event.getTextChannel())) return;

if (!core.update.checkIfUpdate()) {
event.getTextChannel().sendMessage(
":warning: The bot is up to date! ;)"
).queue();
return;
}

core.update.getUpdate(event.getJDA().getGuilds());
update.manualCheck(event.getMessage().getTextChannel());

}

Expand All @@ -58,4 +51,9 @@ public String description() {
public String commandType() {
return STATICS.CMDTYPE.administration;
}

@Override
public int permission() {
return 3;
}
}
5 changes: 5 additions & 0 deletions src/main/java/commands/administration/testCMD.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,9 @@ public String description() {
public String commandType() {
return STATICS.CMDTYPE.administration;
}

@Override
public int permission() {
return 3;
}
}
5 changes: 5 additions & 0 deletions src/main/java/commands/chat/BJoke.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,9 @@ public String description() {
public String commandType() {
return STATICS.CMDTYPE.chatutils;
}

@Override
public int permission() {
return 0;
}
}
6 changes: 6 additions & 0 deletions src/main/java/commands/chat/Cat.java
Original file line number Diff line number Diff line change
Expand Up @@ -135,4 +135,10 @@ public static String getCat() {

return outputMessage;
}


@Override
public int permission() {
return 0;
}
}
5 changes: 5 additions & 0 deletions src/main/java/commands/chat/Clear.java
Original file line number Diff line number Diff line change
Expand Up @@ -188,4 +188,9 @@ public String description() {
public String commandType() {
return STATICS.CMDTYPE.chatutils;
}

@Override
public int permission() {
return 1;
}
}
5 changes: 5 additions & 0 deletions src/main/java/commands/chat/EightBall.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,9 @@ public String description() {
public String commandType() {
return STATICS.CMDTYPE.chatutils;
}

@Override
public int permission() {
return 0;
}
}
5 changes: 5 additions & 0 deletions src/main/java/commands/chat/Joke.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,9 @@ public String description() {
public String commandType() {
return STATICS.CMDTYPE.chatutils;
}

@Override
public int permission() {
return 0;
}
}
7 changes: 6 additions & 1 deletion src/main/java/commands/chat/JokeV2.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,16 @@ public String help() {

@Override
public String description() {
return null;
return "Throw around with some yo mama jokes";
}

@Override
public String commandType() {
return STATICS.CMDTYPE.chatutils;
}

@Override
public int permission() {
return 0;
}
}
7 changes: 6 additions & 1 deletion src/main/java/commands/chat/Quote.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,16 @@ public String help() {

@Override
public String description() {
return null;
return "Quote a message in any channel on guild";
}

@Override
public String commandType() {
return STATICS.CMDTYPE.chatutils;
}

@Override
public int permission() {
return 0;
}
}
Loading

0 comments on commit 42834b9

Please sign in to comment.