Skip to content

Commit

Permalink
2.8.1 - Yay More pixel stuff
Browse files Browse the repository at this point in the history
[New Commands]
+ Ping
+ CheckPixelRoles
+ RequestDailyMessage
+ BotInfo
+ Rank
+ TopTen

[Bug Fixes]
* A couple spelling mistakes.
* Fixed Top Ten Role allocation
* Fixed pixels being granted while xpgain was false.
* Probably fixed the pinned art issue
* Deny Invites no longer says that the user was attempting to put an
invite in a custom command.
* Fixed a bug where you were shown to have a rank higher than what you
were supposed to have.
* Fixed a bug where the sudo command wasn't able to sudo custom commands
properly.

[Changes]
* updated the Pixels command to have a visual display of your progress
to the next level
* formatted pixel numbers to use commas
* changed it so that if you don't have any xp it wont show your level or
rank.
* the embed image tag will now only attempt to upload a file if the user
has the EmbedLinks Permission.
* moved bot info from help command to its own command.
+ added a typing status when sending a command response
  • Loading branch information
Vaerys-Dawn committed Jul 24, 2017
1 parent 09ccf65 commit a89e2ff
Show file tree
Hide file tree
Showing 52 changed files with 1,912 additions and 1,106 deletions.
12 changes: 1 addition & 11 deletions .idea/misc.xml

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

1 change: 0 additions & 1 deletion .idea/vcs.xml

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

1,343 changes: 603 additions & 740 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
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8" inherit-compiler-output="false">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
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.8.0</version>
<version>2.8.1</version>
<build>
<resources>
<resource>
Expand Down
2 changes: 1 addition & 1 deletion 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.8.0</version>
<version>2.8.1</version>

<build>
<resources>
Expand Down
18 changes: 10 additions & 8 deletions src/main/java/Commands/Admin/EditInfoFiles.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@
* Created by Vaerys on 26/06/2017.
*/
public class EditInfoFiles implements Command {

String modes = "**Modes:**\n" +
"> uploadImage - `Requires image file.`\n" +
"> removeImage - `Requires file name.`\n" +
"> listFiles/listImages - `Lists the server's image files.`\n" +
"> uploadInfo - `Requires \"" + Constants.FILE_INFO + "\" file.`\n" +
"> getInfoFile - `Post the server's Info.txt.`";

@Override
public String execute(String args, CommandObject command) {
SplitFirstObject object = new SplitFirstObject(args);
Expand Down Expand Up @@ -41,18 +49,12 @@ public String[] names() {

@Override
public String description() {
return "Allows for editing of the updateInfo command.\n" +
"**Modes:**\n" +
"- uploadImage: **Requires image file.**\n" +
"- removeImage: **Requires file name.**\n" +
"- listFiles/listImages\n" +
"- uploadInfo: **Requires \"" + Constants.FILE_INFO + "\" file.**\n" +
"- getInfoFile";
return "Allows for editing of the updateInfo command.\n" + modes;
}

@Override
public String usage() {
return "[EditMode] (ImageFile/ImageName/Info.txt)";
return "[Mode] (args)";
}

@Override
Expand Down
9 changes: 5 additions & 4 deletions src/main/java/Commands/Admin/UserSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public class UserSettings implements Command {
private String settings = "**Settings**\n" +
"- DeniedXp\n" +
"- DontShowRank\n";

@Override
public String execute(String args, CommandObject command) {
SplitFirstObject split = new SplitFirstObject(args);
Expand All @@ -36,24 +37,24 @@ public String execute(String args, CommandObject command) {
for (UserSetting s : userObject.getSettings()) {
if (s == UserSetting.DENIED_XP) {
userObject.getSettings().remove(s);
return "> User will no longer gain XP.";
return "> User will now gain xp again.";
}
}
} else {
userObject.getSettings().add(UserSetting.DENIED_XP);
return "> User will now gain xp again.";
return "> User will no longer gain XP.";
}
case "dontshowrank":
if (userObject.getSettings().contains(UserSetting.DONT_SHOW_LEADERBOARD)) {
for (UserSetting s : userObject.getSettings()) {
if (s == UserSetting.DONT_SHOW_LEADERBOARD) {
userObject.getSettings().remove(s);
return "> User will no longer display their rank.";
return "> User's rank is now visible.";
}
}
} else {
userObject.getSettings().add(UserSetting.DONT_SHOW_LEADERBOARD);
return "> User's rank is now visible.";
return "> User will no longer display their rank.";
}
default:
return "> Invalid setting.\n" + settings + "\n\n" + Utility.getCommandInfo(this, command);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/Commands/CC/DelCC.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public String type() {

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

@Override
Expand Down
21 changes: 13 additions & 8 deletions src/main/java/Commands/CC/EditCC.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@
* Created by Vaerys on 01/02/2017.
*/
public class EditCC implements Command {

String modes = "**Modes: **\n" +
"> Replace\n" +
"> ToEmbed\n" +
"> DelCall\n";
String adminModes = "**Admin Modes:**\n" +
"> Shitpost\n" +
"> Lock\n";

@Override
public String execute(String args, CommandObject command) {
SplitFirstObject getName = new SplitFirstObject(args);
Expand All @@ -34,7 +43,7 @@ public String execute(String args, CommandObject command) {
if (StringUtils.countMatches(mode + " " + content, "#embedImage#{") > 1) {
return "> Custom Commands Cannot have multiple #embedImage# tags";
}
if(c.isLocked() && !canBypass){
if (c.isLocked() && !canBypass) {
return "> This command is locked and cannot be edited.";
}
switch (mode.toLowerCase()) {
Expand All @@ -51,7 +60,7 @@ public String execute(String args, CommandObject command) {
case "shitpost":
return CCEditModes.shitPost(c, command, command.author, command.guild);
case "lock":
return CCEditModes.lock(c,command,command.author,command.guild);
return CCEditModes.lock(c, command, command.author, command.guild);
default:
if (content == null || content.isEmpty()) {
return CCEditModes.replace(c, mode);
Expand All @@ -68,19 +77,15 @@ public String execute(String args, CommandObject command) {
}



@Override
public String[] names() {
return new String[]{"EditCC"};
}

@Override
public String description() {
return "Allows you to edit a custom command.\n" +
" Modes: Replace, Append, toEmbed, DelCall.\n" +
"**Admin Modes: **lock, Shitpost\n\n" +
"Mode is optional, defaults to replace.\n" +
"[Custom Command Guide](https://github.com/Vaerys-Dawn/DiscordSailv2/wiki/Custom-Command-Guide)";
return "Allows you to edit a custom command.\n" + modes + adminModes +
"**[Custom Command Guide](https://github.com/Vaerys-Dawn/DiscordSailv2/wiki/Custom-Command-Guide)**";
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/Commands/CC/InfoCC.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public String type() {

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

@Override
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/Commands/CC/ListCCs.java
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public String type() {

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

@Override
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/Commands/CC/SearchCCs.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public String type() {

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

@Override
Expand Down
38 changes: 22 additions & 16 deletions src/main/java/Commands/Characters/EditChar.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,34 +11,42 @@
* Created by Vaerys on 26/02/2017.
*/
public class EditChar implements Command {

String modes = "**Modes:**\n" +
"> Age - `Max Chars: 20`\n" +
"> Gender - `Max Chars: 20`\n" +
"> Avatar - `Needs Valid Image URL`\n" +
"> Bio - `Max Chars: 300`\n" +
"> LongDesc - `Needs Valid URL`";

@Override
public String execute(String args, CommandObject command) {
SplitFirstObject charName = new SplitFirstObject(args);
if (charName.getRest() == null || charName.getRest().isEmpty()){
if (charName.getRest() == null || charName.getRest().isEmpty()) {
return "> Mode Not Specified";
}
SplitFirstObject mode = new SplitFirstObject(charName.getRest());
for (CharacterObject c: command.characters.getCharacters()){
if (c.getName().equalsIgnoreCase(charName.getFirstWord())){
if (c.getUserID().equals(command.authorSID) || Utility.canBypass(command.author,command.guild)){
if (mode.getRest() == null || mode.getRest().isEmpty()){
for (CharacterObject c : command.characters.getCharacters()) {
if (c.getName().equalsIgnoreCase(charName.getFirstWord())) {
if (c.getUserID().equals(command.authorSID) || Utility.canBypass(command.author, command.guild)) {
if (mode.getRest() == null || mode.getRest().isEmpty()) {
return "> Missing Arguments for Editing.";
}
switch (mode.getFirstWord().toLowerCase()){
switch (mode.getFirstWord().toLowerCase()) {
case "age":
return CharEditModes.age(mode.getRest(),c);
return CharEditModes.age(mode.getRest(), c);
case "gender":
return CharEditModes.gender(mode.getRest(),c);
return CharEditModes.gender(mode.getRest(), c);
case "avatar":
return CharEditModes.avatar(mode.getRest(),c);
case "desc":
return CharEditModes.desc(mode.getRest(),c);
return CharEditModes.avatar(mode.getRest(), c);
case "bio":
return CharEditModes.desc(mode.getRest(), c);
case "longdesc":
return CharEditModes.longDesc(mode.getRest(),c);
return CharEditModes.longDesc(mode.getRest(), c);
default:
return "> Mode not Valid.";
}
}else {
} else {
return command.notAllowed;
}
}
Expand All @@ -53,9 +61,7 @@ public String[] names() {

@Override
public String description() {
return "Allows the User to edit their Character.\n" +
"Modes: age, Avatar, Desc, Gender, LongDesc\n" +
"\nAvatar and LongDesc need valid URLs.";
return "Allows the User to edit their Character.\n" + modes;
}

@Override
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/Commands/CommandInit.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import Commands.Creator.*;
import Commands.Creator.Shutdown;
import Commands.DMCommands.*;
import Commands.DMCommands.TestDM;
import Commands.General.*;
import Commands.Groups.ClearGroupUp;
import Commands.Groups.GroupUp;
Expand Down Expand Up @@ -67,6 +68,7 @@ public static ArrayList<Command> get() {
commands.add(new SlashList());
commands.add(new ClearReminder());
commands.add(new EditLinks());
commands.add(new Ping());
//Help commands
commands.add(new GetGuildInfo());
commands.add(new Help());
Expand All @@ -75,6 +77,7 @@ public static ArrayList<Command> get() {
commands.add(new Report());
commands.add(new SilentReport());
commands.add(new StartUpGuide());
commands.add(new BotInfo());
//RoleSelect commands
commands.add(new CosmeticRoles());
commands.add(new ModifierRoles());
Expand Down Expand Up @@ -125,6 +128,10 @@ public static ArrayList<Command> get() {
commands.add(new SetXp());
commands.add(new SetLevel());
commands.add(new SetPixelModifier());
commands.add(new CheckPixelRoles());
commands.add(new TopUserForRole());
commands.add(new Rank());
commands.add(new TopTen());

return commands;
}
Expand All @@ -143,6 +150,7 @@ public static ArrayList<DMCommand> getDM() {
commands.add(new ClearReminderDM());
commands.add(new ShutdownDM());
commands.add(new QuickRespond());
commands.add(new TestDM());
return commands;
}

Expand Down
46 changes: 46 additions & 0 deletions src/main/java/Commands/DMCommands/TestDM.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package Commands.DMCommands;

import Commands.DMCommandObject;
import Interfaces.DMCommand;
import sx.blah.discord.handle.obj.IChannel;

/**
* Created by Vaerys on 15/07/2017.
*/
public class TestDM implements DMCommand {
@Override
public String execute(String args, DMCommandObject command) {
// for (IChannel c : command.client.getGuildByID(176434793674833920L).getChannels()) {
// if (("#" + c.getName()).equalsIgnoreCase(args)) {
// return c.getName();
// }
// }
// return "channel could not be found";
return "> You've done your testing";
}

@Override
public String[] names() {
return new String[]{"Test"};
}

@Override
public String description() {
return "Is a test";
}

@Override
public String usage() {
return "[args]";
}

@Override
public String type() {
return TYPE_CREATOR;
}

@Override
public boolean requiresArgs() {
return true;
}
}
Loading

0 comments on commit a89e2ff

Please sign in to comment.