Skip to content

Commit

Permalink
2.6.0 - First set of Overhauls
Browse files Browse the repository at this point in the history
+ Patch system to allow for safe updates to file data.
* Overhauled RemindMe command, reminders are now a lot more accurate and
have a hard cap of 1 year, they are now global and persist between
restarts.
+ Dm command RemindMe added
+ ClearReminder command.
+ Dm command ClearReminder added
+ dontlogBot toggle
* Completely overhauled the channelhere system to allow for certain
channels types/settings to allow for multiple channels.
* Custom commands now use `<tag>` instead of `#tag#` for custom
commands. all previously created custom commands will be automatically
fixed to use the new system.
+ lock check for editing ccs.
  • Loading branch information
Vaerys-Dawn committed Apr 19, 2017
1 parent ec844a1 commit c911e3d
Show file tree
Hide file tree
Showing 111 changed files with 2,276 additions and 1,217 deletions.
900 changes: 491 additions & 409 deletions .idea/workspace.xml

Large diffs are not rendered by default.

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.5.5</version>
<version>2.6.0</version>
<build>
<resources>
<resource>
Expand Down
7 changes: 1 addition & 6 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.5.5</version>
<version>2.6.0</version>

<build>
<resources>
Expand Down Expand Up @@ -84,11 +84,6 @@
<artifactId>json</artifactId>
<version>20140107</version>
</dependency>
<!--<dependency>-->
<!--<groupId>com.google.code.findbugs</groupId>-->
<!--<artifactId>jsr305</artifactId>-->
<!--<version>1.3.9</version>-->
<!--</dependency>-->
<dependency>
<groupId>com.github.austinv11</groupId>
<artifactId>Discord4j</artifactId>
Expand Down
14 changes: 0 additions & 14 deletions src/main/java/Annotations/AliasAnnotation.java

This file was deleted.

19 changes: 0 additions & 19 deletions src/main/java/Annotations/DualCommandAnnotation.java

This file was deleted.

17 changes: 0 additions & 17 deletions src/main/java/Annotations/ToggleAnnotation.java

This file was deleted.

32 changes: 32 additions & 0 deletions src/main/java/ChannelSettings/InitChannels.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package ChannelSettings;

import ChannelSettings.Settings.*;
import ChannelSettings.Types.*;
import Interfaces.ChannelSetting;

import java.util.ArrayList;

/**
* Created by Vaerys on 09/04/2017.
*/
public class InitChannels {

public static ArrayList<ChannelSetting> get() {
ArrayList<ChannelSetting> channelSettings = new ArrayList<>();

//Channel Types
channelSettings.add(new General());
channelSettings.add(new Info());
channelSettings.add(new Admin());
channelSettings.add(new AdminLog());
channelSettings.add(new ServerLog());

//Channel Settings
channelSettings.add(new Shitpost());
channelSettings.add(new Servers());
channelSettings.add(new BotCommands());
channelSettings.add(new DontLog());

return channelSettings;
}
}
19 changes: 19 additions & 0 deletions src/main/java/ChannelSettings/Settings/BotCommands.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package ChannelSettings.Settings;

import Interfaces.ChannelSetting;
import Interfaces.Command;

/**
* Created by Vaerys on 09/04/2017.
*/
public class BotCommands implements ChannelSetting{
@Override
public String type() {
return Command.CHANNEL_BOT_COMMANDS;
}

@Override
public boolean isSetting() {
return true;
}
}
19 changes: 19 additions & 0 deletions src/main/java/ChannelSettings/Settings/DontLog.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package ChannelSettings.Settings;

import Interfaces.ChannelSetting;
import Interfaces.Command;

/**
* Created by Vaerys on 09/04/2017.
*/
public class DontLog implements ChannelSetting {
@Override
public String type() {
return Command.CHANNEL_DONT_LOG;
}

@Override
public boolean isSetting() {
return false;
}
}
19 changes: 19 additions & 0 deletions src/main/java/ChannelSettings/Settings/Servers.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package ChannelSettings.Settings;

import Interfaces.ChannelSetting;
import Interfaces.Command;

/**
* Created by Vaerys on 09/04/2017.
*/
public class Servers implements ChannelSetting {
@Override
public String type() {
return Command.CHANNEL_SERVERS;
}

@Override
public boolean isSetting() {
return true;
}
}
19 changes: 19 additions & 0 deletions src/main/java/ChannelSettings/Settings/Shitpost.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package ChannelSettings.Settings;

import Interfaces.ChannelSetting;
import Interfaces.Command;

/**
* Created by Vaerys on 09/04/2017.
*/
public class Shitpost implements ChannelSetting{
@Override
public String type() {
return Command.CHANNEL_SHITPOST;
}

@Override
public boolean isSetting() {
return true;
}
}
19 changes: 19 additions & 0 deletions src/main/java/ChannelSettings/Types/Admin.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package ChannelSettings.Types;

import Interfaces.ChannelSetting;
import Interfaces.Command;

/**
* Created by Vaerys on 09/04/2017.
*/
public class Admin implements ChannelSetting {
@Override
public String type() {
return Command.CHANNEL_ADMIN;
}

@Override
public boolean isSetting() {
return false;
}
}
19 changes: 19 additions & 0 deletions src/main/java/ChannelSettings/Types/AdminLog.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package ChannelSettings.Types;

import Interfaces.ChannelSetting;
import Interfaces.Command;

/**
* Created by Vaerys on 09/04/2017.
*/
public class AdminLog implements ChannelSetting {
@Override
public String type() {
return Command.CHANNEL_ADMIN_LOG;
}

@Override
public boolean isSetting() {
return false;
}
}
19 changes: 19 additions & 0 deletions src/main/java/ChannelSettings/Types/General.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package ChannelSettings.Types;

import Interfaces.ChannelSetting;
import Interfaces.Command;

/**
* Created by Vaerys on 09/04/2017.
*/
public class General implements ChannelSetting {
@Override
public String type() {
return Command.CHANNEL_GENERAL;
}

@Override
public boolean isSetting() {
return false;
}
}
19 changes: 19 additions & 0 deletions src/main/java/ChannelSettings/Types/Info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package ChannelSettings.Types;

import Interfaces.ChannelSetting;
import Interfaces.Command;

/**
* Created by Vaerys on 09/04/2017.
*/
public class Info implements ChannelSetting{
@Override
public String type() {
return Command.CHANNEL_INFO;
}

@Override
public boolean isSetting() {
return false;
}
}
19 changes: 19 additions & 0 deletions src/main/java/ChannelSettings/Types/ServerLog.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package ChannelSettings.Types;

import Interfaces.ChannelSetting;
import Interfaces.Command;

/**
* Created by Vaerys on 09/04/2017.
*/
public class ServerLog implements ChannelSetting{
@Override
public String type() {
return Command.CHANNEL_SERVER_LOG;
}

@Override
public boolean isSetting() {
return false;
}
}
26 changes: 15 additions & 11 deletions src/main/java/Commands/Admin/ChannelHere.java
Original file line number Diff line number Diff line change
@@ -1,37 +1,41 @@
package Commands.Admin;

import Commands.CommandObject;
import Interfaces.ChannelSetting;
import Interfaces.Command;
import Main.Utility;
import Objects.XEmbedBuilder;
import sx.blah.discord.handle.obj.Permissions;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;

/**
* Created by Vaerys on 31/01/2017.
*/
public class ChannelHere implements Command {
@Override
public String execute(String args, CommandObject command) {
StringBuilder builder = new StringBuilder();
String desc = "";
if (!args.isEmpty()) {
for (String channelType : command.channelTypes) {
if (args.equalsIgnoreCase(channelType)) {
command.guildConfig.setUpChannel(channelType, command.channelID);
return "> This channel is now the Server's **" + channelType + "** channel.";
for (ChannelSetting s : command.channelSettings) {
if (args.equalsIgnoreCase(s.type())) {
return s.toggleSetting(command.guildConfig,command.channelID);
}

}
builder.append("> Could not find channel type \"" + args + "\"\n");
desc = "> Could not find channel type \"" + args + "\"\n";
}
XEmbedBuilder embedBuilder = new XEmbedBuilder();
String title = "> Here is a list of available Channel Types:\n";
ArrayList<String> channels = command.channelTypes;
Collections.sort(channels);
embedBuilder.withDesc(builder.toString());
Utility.listFormatterEmbed(title, embedBuilder, channels, true);

ArrayList<ChannelSetting> channelSettings = command.channelSettings;
List<String> types = channelSettings.stream().map(ChannelSetting::type).collect(Collectors.toList());
Collections.sort(types);
embedBuilder.withDesc(desc);
Utility.listFormatterEmbed(title, embedBuilder, (ArrayList<String>) types, true);
embedBuilder.appendField(spacer, Utility.getCommandInfo(this, command), false);
embedBuilder.withColor(Utility.getUsersColour(command.client.getOurUser(), command.guild));
Utility.sendEmbedMessage("", embedBuilder, command.channel);
Expand All @@ -40,7 +44,7 @@ public String execute(String args, CommandObject command) {

@Override
public String[] names() {
return new String[]{"ChannelHere", "SetupChannel"};
return new String[]{"Channel", "ChannelHere", "ChannelSetting"};
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/Commands/Admin/UpdateInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
public class UpdateInfo implements Command {
@Override
public String execute(String args, CommandObject command) {
if (command.guildConfig.getChannelTypeID(Command.CHANNEL_INFO) == null) {
if (command.guildConfig.getChannelIDsByType(Command.CHANNEL_INFO) == null) {
return "> No Info channel set up yet, you need to set one up in order to run this command.\n" + Utility.getCommandInfo(this,command);
} else {
new InfoHandler(command.channel, command.guild);
Expand Down
7 changes: 7 additions & 0 deletions src/main/java/Commands/BlackList/BlacklistEditModes.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package Commands.BlackList;

/**
* Created by Vaerys on 04/04/2017.
*/
public class BlacklistEditModes {
}
7 changes: 7 additions & 0 deletions src/main/java/Commands/BlackList/EditBlackList.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package Commands.BlackList;

/**
* Created by Vaerys on 04/04/2017.
*/
public class EditBlackList {
}
7 changes: 7 additions & 0 deletions src/main/java/Commands/BlackList/ListBlackLists.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package Commands.BlackList;

/**
* Created by Vaerys on 04/04/2017.
*/
public class ListBlackLists {
}
9 changes: 9 additions & 0 deletions src/main/java/Commands/BlackList/NewBlackList.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package Commands.BlackList;

/**
* Created by Vaerys on 04/04/2017.
*/
public class NewBlackList {

//todo this.
}
Loading

0 comments on commit c911e3d

Please sign in to comment.