Skip to content

Commit

Permalink
2.4.4 - Fixes
Browse files Browse the repository at this point in the history
* updated to latest dev branch `5213b02`
* fixed null pointer in messageDeleteEvent.
+ added a login check when sail autosaves files every 5 mins.
- Removed .Class files from commit
  • Loading branch information
Vaerys-Dawn committed Feb 16, 2017
1 parent 03ea29c commit 503e950
Show file tree
Hide file tree
Showing 125 changed files with 267 additions and 158 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,5 @@ Storage
*.json1
*.json2
*.json3
bot.log
bot.log
*.class

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

348 changes: 215 additions & 133 deletions .idea/workspace.xml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion DiscordSAIL.iml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Maven: org.json:json:20140107" level="project" />
<orderEntry type="library" name="Maven: com.google.code.findbugs:jsr305:1.3.9" level="project" />
<orderEntry type="library" name="Maven: com.github.austinv11:Discord4j:shaded:5d4c4db" level="project" />
<orderEntry type="library" name="Maven: com.github.austinv11:Discord4j:shaded:5213b02" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.21" level="project" />
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.5" level="project" />
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.2" level="project" />
Expand Down
2 changes: 1 addition & 1 deletion dependency-reduced-pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.vaerys</groupId>
<artifactId>DiscordSAIL</artifactId>
<version>2.4.3</version>
<version>2.4.4</version>
<build>
<resources>
<resource>
Expand Down
1 change: 1 addition & 0 deletions genGource.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
gource -a 0.1 --file-filter .class --file-filter .idea --viewport 1080x720 --file-filter FrenchGirl --user-image-dir E:\Repositories\GitUserAvatars
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.github.vaerys</groupId>
<artifactId>DiscordSAIL</artifactId>
<version>2.4.3</version>
<version>2.4.4</version>

<build>
<resources>
Expand Down Expand Up @@ -93,7 +93,7 @@
<dependency>
<groupId>com.github.austinv11</groupId>
<artifactId>Discord4j</artifactId>
<version>5d4c4db</version>
<version>5213b02</version>
<classifier>shaded</classifier>
</dependency>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/Commands/CC/EditCC.java
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ public String type() {

@Override
public String channel() {
return CHANNEL_BOT_COMMANDS;
return null;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package Commands.Admin;
package Commands.Competition;

import Commands.Command;
import Commands.CommandObject;
Expand Down Expand Up @@ -57,7 +57,7 @@ public String usage() {

@Override
public String type() {
return TYPE_ADMIN;
return TYPE_COMPETITION;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package Commands.Admin;
package Commands.Competition;

import Commands.Command;
import Commands.CommandObject;
Expand Down Expand Up @@ -43,7 +43,7 @@ public String usage() {

@Override
public String type() {
return TYPE_ADMIN;
return TYPE_COMPETITION;
}

@Override
Expand Down
18 changes: 12 additions & 6 deletions src/main/java/Listeners/AnnotationListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public void onReadyEvent(ReadyEvent event) {
Utility.updateUsername(Globals.botName);
}


// TODO: 15/02/2017 ---------------PIXEL XP-----------------
// TODO: 16/01/2017 add xp system 20 xp per min max, decay of 150 xp per day, level up to be exponential unsure at what rate tho
// TODO: 16/01/2017 roles removed when level threshold is no longer high enough, ability to set role to gain on level,
// TODO: 16/01/2017 min word limit to gain xp default = 10 words,
Expand Down Expand Up @@ -245,21 +245,27 @@ public void onMessageDeleteEvent(MessageDeleteEvent event){
String content;
IChannel logging = command.client.getChannelByID(command.guildConfig.getChannelTypeID(Command.CHANNEL_SERVER_LOG));
IUser ourUser = command.client.getOurUser();
if (command.guildConfig.getChannelTypeID(Command.CHANNEL_INFO).equals(command.channelID) && ourUser.getID().equals(command.authorID)){
String infoID = command.guildConfig.getChannelTypeID(Command.CHANNEL_INFO);
String serverLogID = command.guildConfig.getChannelTypeID(Command.CHANNEL_SERVER_LOG);
String adminLogID = command.guildConfig.getChannelTypeID(Command.CHANNEL_ADMIN_LOG);
if (event.getMessage() == null){
return;
}
if (serverLogID != null && serverLogID.equals(command.channelID) && ourUser.getID().equals(command.authorID)){
return;
}
if (command.guildConfig.getChannelTypeID(Command.CHANNEL_SERVER_LOG).equals(command.channelID) && ourUser.getID().equals(command.authorID)){
if (infoID != null && serverLogID.equals(command.channelID) && ourUser.getID().equals(command.authorID)){
return;
}
if (command.guildConfig.getChannelTypeID(Command.CHANNEL_ADMIN_LOG).equals(command.channelID) && ourUser.getID().equals(command.authorID)){
if (adminLogID != null && serverLogID.equals(command.channelID) && ourUser.getID().equals(command.authorID)){
return;
}
if (logging != null && command.guildConfig.doDeleteLogging()){
if (command.message.getContent().isEmpty()){
return;
}
int charlimit = 1800;
if (command.message.getContent().length() > charlimit){
int charLimit = 1800;
if (command.message.getContent().length() > charLimit){
content = command.message.getContent().substring(0,1800);
}else {
content = command.message.getContent();
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/Main/Globals.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
import Commands.Command;
import Commands.Competition.EnterComp;
import Commands.Competition.EnterVote;
import Commands.Competition.FinalTally;
import Commands.Competition.GetCompEntries;
import Commands.DMCommand;
import Commands.DMCommands.BlockUser;
import Commands.DMCommands.HelpDM;
Expand Down
21 changes: 19 additions & 2 deletions src/main/java/Main/TimedEvents.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@
import Objects.ReminderObject;
import Objects.TimedObject;
import Objects.WaiterObject;
import POGOs.GlobalData;
import POGOs.GuildConfig;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import sx.blah.discord.api.IDiscordClient;
import sx.blah.discord.handle.obj.IChannel;
import sx.blah.discord.handle.obj.IUser;
import sx.blah.discord.util.DiscordException;
import sx.blah.discord.util.Image;

import java.io.File;
Expand Down Expand Up @@ -80,7 +83,7 @@ private static void dailyTasks() {
@Override
public void run() {
ZonedDateTime timeNow = ZonedDateTime.now(ZoneOffset.UTC);
String dailyFileName = Globals.dailyAvatarName.replace("#day#",timeNow.getDayOfWeek().toString());
String dailyFileName = Globals.dailyAvatarName.replace("#day#", timeNow.getDayOfWeek().toString());
DayOfWeek day = timeNow.getDayOfWeek();
File avatarFile;

Expand Down Expand Up @@ -234,8 +237,22 @@ private static void doTaskFiveMin() {
timer.schedule(new TimerTask() {
@Override
public void run() {
//Sending isAlive Check.
try {
Globals.getClient().checkLoggedIn("IsAlive");
} catch (DiscordException e) {
logger.error(e.getErrorMessage());
logger.info("Logging back in.");
try {
Globals.getClient().login();
return;
} catch (IllegalStateException ex) {
//ignore exception
}
}
Globals.saveFiles();
}
}, 2* 60 * 1000, 5 * 60 * 1000);
}, 2 * 60 * 1000, 5 * 60 * 1000);
}

}
Binary file modified target/JavaDiscordSAILv2.jar
Binary file not shown.
Binary file removed target/classes/Annotations/AliasAnnotation.class
Binary file not shown.
Binary file removed target/classes/Annotations/DualCommandAnnotation.class
Binary file not shown.
Binary file removed target/classes/Annotations/TagAnnotation.class
Binary file not shown.
Binary file removed target/classes/Annotations/ToggleAnnotation.class
Binary file not shown.
Binary file removed target/classes/BadCode/CustomCommands.class
Binary file not shown.
Binary file removed target/classes/Commands/Admin/ChannelHere.class
Binary file not shown.
Binary file removed target/classes/Commands/Admin/FinalTally.class
Binary file not shown.
Binary file removed target/classes/Commands/Admin/GetCompEntries.class
Binary file not shown.
Binary file removed target/classes/Commands/Admin/SetAdminRole.class
Binary file not shown.
Binary file removed target/classes/Commands/Admin/SetMutedRole.class
Binary file not shown.
Binary file removed target/classes/Commands/Admin/SetTrustedRoles.class
Binary file not shown.
Binary file removed target/classes/Commands/Admin/Shutdown.class
Binary file not shown.
Binary file removed target/classes/Commands/Admin/Sudo.class
Binary file not shown.
Binary file removed target/classes/Commands/Admin/Toggle.class
Binary file not shown.
Binary file removed target/classes/Commands/Admin/UpdateAvatar.class
Binary file not shown.
Binary file removed target/classes/Commands/Admin/UpdateInfo.class
Binary file not shown.
Binary file removed target/classes/Commands/Admin/UpdateRolePerms.class
Binary file not shown.
Binary file removed target/classes/Commands/CC/DelCC.class
Binary file not shown.
Binary file removed target/classes/Commands/CC/EditCC.class
Binary file not shown.
Binary file removed target/classes/Commands/CC/GetCCData.class
Binary file not shown.
Binary file removed target/classes/Commands/CC/InfoCC.class
Binary file not shown.
Binary file removed target/classes/Commands/CC/ListCCs.class
Binary file not shown.
Binary file removed target/classes/Commands/CC/NewCC.class
Binary file not shown.
Binary file removed target/classes/Commands/CC/SearchCCs.class
Binary file not shown.
Binary file removed target/classes/Commands/CC/TransferCC.class
Binary file not shown.
Binary file removed target/classes/Commands/Characters/DelChar.class
Binary file not shown.
Binary file removed target/classes/Commands/Characters/ListChars.class
Binary file not shown.
Binary file removed target/classes/Commands/Characters/SelectChar.class
Binary file not shown.
Binary file removed target/classes/Commands/Characters/UpdateChar.class
Binary file not shown.
Binary file removed target/classes/Commands/Command.class
Binary file not shown.
Binary file removed target/classes/Commands/CommandObject.class
Binary file not shown.
Binary file removed target/classes/Commands/Competition/EnterComp.class
Binary file not shown.
Binary file removed target/classes/Commands/Competition/EnterVote.class
Binary file not shown.
Binary file removed target/classes/Commands/DMCommand.class
Binary file not shown.
Binary file removed target/classes/Commands/DMCommandObject.class
Binary file not shown.
Binary file removed target/classes/Commands/DMCommands/BlockUser.class
Binary file not shown.
Binary file removed target/classes/Commands/DMCommands/HelpDM.class
Binary file not shown.
Binary file removed target/classes/Commands/DMCommands/InfoDM.class
Binary file not shown.
Binary file removed target/classes/Commands/DMCommands/Respond.class
Binary file not shown.
Binary file removed target/classes/Commands/General/GetAvatar.class
Binary file not shown.
Binary file removed target/classes/Commands/General/Hello.class
Binary file not shown.
Binary file removed target/classes/Commands/General/RemindMe.class
Binary file not shown.
Binary file removed target/classes/Commands/General/Test.class
Binary file not shown.
Binary file removed target/classes/Commands/Help/GetGuildInfo.class
Binary file not shown.
Binary file removed target/classes/Commands/Help/Help.class
Binary file not shown.
Binary file removed target/classes/Commands/Help/HelpTags.class
Binary file not shown.
Binary file removed target/classes/Commands/Help/Info.class
Binary file not shown.
Binary file removed target/classes/Commands/Help/Report.class
Binary file not shown.
Binary file removed target/classes/Commands/Help/SilentReport.class
Binary file not shown.
Binary file not shown.
Binary file removed target/classes/Commands/RoleSelect/ListModifs.class
Binary file not shown.
Binary file removed target/classes/Commands/RoleSelect/ListRoles.class
Binary file not shown.
Binary file not shown.
Binary file removed target/classes/Commands/Servers/AddServer.class
Binary file not shown.
Binary file removed target/classes/Commands/Servers/DelServer.class
Binary file not shown.
Binary file removed target/classes/Commands/Servers/EditServerDesc.class
Binary file not shown.
Binary file removed target/classes/Commands/Servers/EditServerIP.class
Binary file not shown.
Binary file removed target/classes/Commands/Servers/EditServerName.class
Binary file not shown.
Binary file removed target/classes/Commands/Servers/ListServers.class
Binary file not shown.
Binary file removed target/classes/Commands/Servers/Server.class
Binary file not shown.
Binary file removed target/classes/Handlers/CCHandler.class
Binary file not shown.
Binary file removed target/classes/Handlers/DMHandler.class
Binary file not shown.
Binary file removed target/classes/Handlers/FileHandler.class
Binary file not shown.
Binary file removed target/classes/Handlers/InfoHandler.class
Binary file not shown.
Binary file removed target/classes/Handlers/MessageHandler.class
Binary file not shown.
Binary file removed target/classes/Listeners/AnnotationListener.class
Binary file not shown.
Binary file removed target/classes/Main/Client.class
Binary file not shown.
Binary file removed target/classes/Main/Constants.class
Binary file not shown.
Binary file removed target/classes/Main/Globals.class
Binary file not shown.
Binary file removed target/classes/Main/Main$1.class
Binary file not shown.
Binary file removed target/classes/Main/Main.class
Binary file not shown.
Binary file removed target/classes/Main/TagSystem.class
Binary file not shown.
Binary file removed target/classes/Main/TimedEvents$1.class
Binary file not shown.
Binary file removed target/classes/Main/TimedEvents$2.class
Binary file not shown.
Binary file removed target/classes/Main/TimedEvents$3.class
Binary file not shown.
Binary file removed target/classes/Main/TimedEvents$4.class
Binary file not shown.
Binary file removed target/classes/Main/TimedEvents$5.class
Binary file not shown.
Binary file removed target/classes/Main/TimedEvents.class
Binary file not shown.
Binary file removed target/classes/Main/Utility$1.class
Binary file not shown.
Binary file removed target/classes/Main/Utility$2.class
Binary file not shown.
Binary file removed target/classes/Main/Utility.class
Binary file not shown.
Binary file removed target/classes/Objects/BlackListObject.class
Binary file not shown.
Binary file removed target/classes/Objects/CCommandObject.class
Binary file not shown.
Binary file removed target/classes/Objects/ChannelTypeObject.class
Binary file not shown.
Binary file removed target/classes/Objects/CharacterObject.class
Binary file not shown.
Binary file removed target/classes/Objects/DailyMessageObject.class
Binary file not shown.
Binary file removed target/classes/Objects/GuildContentObject.class
Binary file not shown.
Binary file removed target/classes/Objects/MessageErrorObject.class
Binary file not shown.
Binary file removed target/classes/Objects/OffenderObject.class
Binary file not shown.
Binary file removed target/classes/Objects/PollObject.class
Binary file not shown.
Binary file removed target/classes/Objects/ReminderObject.class
Binary file not shown.
Binary file removed target/classes/Objects/ReplaceObject.class
Binary file not shown.
Binary file removed target/classes/Objects/RoleStatsObject.class
Binary file not shown.
Binary file removed target/classes/Objects/RoleTypeObject.class
Binary file not shown.
Binary file removed target/classes/Objects/ServerObject.class
Binary file not shown.
Binary file removed target/classes/Objects/SplitFirstObject.class
Binary file not shown.
Binary file removed target/classes/Objects/TimedObject.class
Binary file not shown.
Binary file removed target/classes/Objects/UserTypeObject.class
Binary file not shown.
Binary file removed target/classes/Objects/WaiterObject.class
Binary file not shown.
Binary file removed target/classes/POGOs/Characters.class
Binary file not shown.
Binary file removed target/classes/POGOs/Competition.class
Binary file not shown.
Binary file removed target/classes/POGOs/Config$1.class
Binary file not shown.
Binary file removed target/classes/POGOs/Config.class
Binary file not shown.
Binary file removed target/classes/POGOs/CustomCommands.class
Binary file not shown.
Binary file removed target/classes/POGOs/GlobalData.class
Binary file not shown.
Binary file removed target/classes/POGOs/GuildConfig.class
Binary file not shown.
Binary file removed target/classes/POGOs/GuildUsers.class
Binary file not shown.
Binary file removed target/classes/POGOs/Servers.class
Binary file not shown.
2 changes: 1 addition & 1 deletion target/classes/project.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version=2.4.3
version=2.4.4
4 changes: 2 additions & 2 deletions target/maven-archiver/pom.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#Generated by Maven
#Mon Feb 13 18:55:32 AEDT 2017
version=2.4.3
#Thu Feb 16 17:43:19 AEDT 2017
version=2.4.4
groupId=com.github.vaerys
artifactId=DiscordSAIL
Binary file modified target/original-JavaDiscordSAILv2.jar
Binary file not shown.

0 comments on commit 503e950

Please sign in to comment.