Skip to content

Commit

Permalink
2.8.0 - The Pixels update.
Browse files Browse the repository at this point in the history
**[New Features]**
+ Pixel Xp system
> xp gain of 20 xp per message
> Xp gain is off by default in case you want to be able to use the
transferLevels command to move old levels to the new system (turns on
XpGain)
> reward Roles
> many settings avalible to customise the system to your liking
> automatic role allocation and removal (only when handled via the
system)
> optional xp decay (off by default)
> ability to set the levels of a user based on their current reward
roles.
> Top ten users can get a special role.
> CCs are now granted based on your rewardRoles or if the module is off
+40 slots
+ user Settings
> ability to attach tags to a user to tell sail what to do with them
> some are able to be obtained by the user
> some are admin only
+ Channel statistics
> ability to get all of the types and settings attatched to a channel
+ Character Bio Role prefix
> enables the ability to set what shows up before the roles on a
character bio.
+ Join Messages
> enables you to set a message that users will see when they first join
the server.

**[New Commands]**
+ ChannelStats
+ SetJoinMessage
+ UserSettings
+ SetCharRolePrefix
+ DefaultLevelMode
+ SetLvlMessage
+ ManagePixelRoles
+ PixelHelp
+ Pixels
+ PixelSettings
+ SetLevel
+ SetPixelMultiplier
+ SetPixels
+ TransferLevels

**[New Toggles/Modules]**
+ JoinServerMessages
+ XpDecay
+ XpGain
+ Pixels

**[New Channel Types/Settings]**
+ XpDenied
+ LevelUpDenied
+ Pixels
+ LevelUp

**[Bug Fixes]**
* url generated image embeds now have the proper filename (also fixes a
bug where images wouldnt embed properly)
* Reorginised command perm/channel/args checks so that they are in the
best order.
* Updated UserInfo to show the user's Pixel level.
* many more minor fixes.
  • Loading branch information
Vaerys-Dawn committed Jul 7, 2017
1 parent bbaaba9 commit 09ccf65
Show file tree
Hide file tree
Showing 58 changed files with 3,143 additions and 676 deletions.

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

883 changes: 502 additions & 381 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 @@ -12,7 +12,7 @@
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Maven: org.json:json:20140107" level="project" />
<orderEntry type="library" name="Maven: com.github.austinv11:Discord4j:shaded:2.8.3" level="project" />
<orderEntry type="library" name="Maven: com.github.austinv11:Discord4j:shaded:2.8.4" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.24" level="project" />
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.6" level="project" />
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.3" 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.7.1</version>
<version>2.8.0</version>
<build>
<resources>
<resource>
Expand Down
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.7.1</version>
<version>2.8.0</version>

<build>
<resources>
Expand Down Expand Up @@ -87,7 +87,7 @@
<dependency>
<groupId>com.github.austinv11</groupId>
<artifactId>Discord4j</artifactId>
<version>2.8.3</version>
<version>2.8.4</version>
<classifier>shaded</classifier>
</dependency>
<dependency>
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/ChannelSettings/InitChannels.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,16 @@ public static ArrayList<ChannelSetting> get() {
channelSettings.add(new AdminLog());
channelSettings.add(new ServerLog());
channelSettings.add(new Art());
channelSettings.add(new LevelUp());

//Channel Settings
channelSettings.add(new Rank());
channelSettings.add(new Shitpost());
channelSettings.add(new Servers());
channelSettings.add(new BotCommands());
channelSettings.add(new Groups());
channelSettings.add(new XpDenied());
channelSettings.add(new LevelUpDenied());

return channelSettings;
}
Expand Down
19 changes: 19 additions & 0 deletions src/main/java/ChannelSettings/Settings/LevelUpDenied.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 04/07/2017.
*/
public class LevelUpDenied implements ChannelSetting {
@Override
public String type() {
return Command.CHANNEL_LEVEL_UP_DENIED;
}

@Override
public boolean isSetting() {
return true;
}
}
19 changes: 19 additions & 0 deletions src/main/java/ChannelSettings/Settings/Rank.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 01/07/2017.
*/
public class Rank implements ChannelSetting{
@Override
public String type() {
return Command.CHANNEL_PIXELS;
}

@Override
public boolean isSetting() {
return true;
}
}
2 changes: 1 addition & 1 deletion src/main/java/ChannelSettings/Settings/XpDenied.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
public class XpDenied implements ChannelSetting {
@Override
public String type() {
return Command.Channel_XP_DENIED;
return Command.CHANNEL_XP_DENIED;
}

@Override
Expand Down
19 changes: 19 additions & 0 deletions src/main/java/ChannelSettings/Types/LevelUp.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 02/07/2017.
*/
public class LevelUp implements ChannelSetting {
@Override
public String type() {
return Command.CHANNEL_LEVEL_UP;
}

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

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

import java.util.ArrayList;

/**
* Created by Vaerys on 01/07/2017.
*/
public class ChannelStats implements Command {
@Override
public String execute(String args, CommandObject command) {
XEmbedBuilder builder = new XEmbedBuilder();

ArrayList<String> channelTypes = new ArrayList<>();
ArrayList<String> channelSettings = new ArrayList<>();

for (ChannelSettingObject c : command.guildConfig.getChannelSettings()) {
if (c.getChannelIDs().contains(command.channelSID)) {
for (ChannelSetting setting : Globals.getChannelSettings()) {
if (c.getType().equalsIgnoreCase(setting.type())) {
if (setting.isSetting()) {
channelSettings.add(c.getType());
} else {
channelTypes.add(c.getType());
}
}
}
}
}


builder.withTitle("Channel Stats");
builder.withColor(Utility.getUsersColour(command.botUser,command.guild));
if (channelSettings.size() == 0 && channelTypes.size() == 0){
return "> I found nothing of value.";
}
if (channelTypes.size() != 0) {
builder.appendField("Types:", Utility.listFormatter(channelTypes, true), false);
}
if (channelSettings.size() != 0) {
builder.appendField("Settings:", Utility.listFormatter(channelSettings, true), false);
}
Utility.sendEmbedMessage("",builder,command.channel);
return null;
}

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

@Override
public String description() {
return "Gives information about the current channel";
}

@Override
public String usage() {
return null;
}

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

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

@Override
public Permissions[] perms() {
return new Permissions[]{Permissions.MANAGE_CHANNELS};
}

@Override
public boolean requiresArgs() {
return false;
}

@Override
public boolean doAdminLogging() {
return false;
}

@Override
public String dualDescription() {
return null;
}

@Override
public String dualUsage() {
return null;
}

@Override
public String dualType() {
return null;
}

@Override
public Permissions[] dualPerms() {
return new Permissions[0];
}
}
Original file line number Diff line number Diff line change
@@ -1,36 +1,40 @@
package Commands.Creator;
package Commands.Admin;

import Commands.CommandObject;
import Interfaces.Command;
import sx.blah.discord.handle.obj.Permissions;

/**
* Created by Vaerys on 02/03/2017.
* Created by Vaerys on 07/07/2017.
*/
public class TempCommand implements Command {
public class SetJoinMessage implements Command {
@Override
public String execute(String args, CommandObject command) {
return "Doesnt do anything right now";
command.guildConfig.setJoinMessage(args);
return "> New Join Message set.";
}

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

@Override
public String description() {
return "Bleh";
return "Allows for the setting of the message that shows when a user joins the server.\n" +
"**Available tags**\n" +
"<server> = Server Name\n" +
"<user> = User's Name";
}

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

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

@Override
Expand All @@ -40,12 +44,12 @@ public String channel() {

@Override
public Permissions[] perms() {
return new Permissions[0];
return new Permissions[]{Permissions.MANAGE_SERVER};
}

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

@Override
Expand Down
Loading

0 comments on commit 09ccf65

Please sign in to comment.