-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Commands] + PruneUserProfiles + GetGlobalStats + FixLevelErrors + setlevelUpReaction + dailymsg + denyxpprefix [Changes] * Some major and minor optimisations * updated the format for storing roleIDs * some changes to the role commands * put a cap on the xp and level calculations. + you can now stop xp gain for the use of certain commands. [New User Settings] + DenyMakeCC + DenyUseCCs + AutoShitpost [New Toggles] + UserInfoShowsDate + SelfDestructLevelUps + reactOnLevelUp [New Channel Setting] + DontLog (Finally omg)
- Loading branch information
1 parent
a89e2ff
commit 596f97d
Showing
108 changed files
with
2,789 additions
and
1,502 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
package Commands.Admin; | ||
|
||
import Commands.CommandObject; | ||
import Interfaces.Command; | ||
import Main.Utility; | ||
import sx.blah.discord.handle.obj.Permissions; | ||
|
||
import java.util.ArrayList; | ||
import java.util.ListIterator; | ||
|
||
public class DenyXpPrefix implements Command { | ||
|
||
@Override | ||
public String execute(String args, CommandObject command) { | ||
if (args.equalsIgnoreCase("list")) { | ||
return "> Here are all of the prefixes that are registered.\n```" + | ||
Utility.listFormatter(command.guildConfig.getXPDeniedPrefixes(), true) + "```"; | ||
} | ||
boolean isAlphanumeric = args.matches("[A-Za-z0-9]+"); | ||
if (args.length() > 5) { | ||
return "> Prefix cannot be longer than 5 chars."; | ||
} | ||
if (args.contains("\n")) { | ||
return "> Prefix cannot contain newlines."; | ||
} | ||
if (args.contains(" ")) { | ||
return "> Prefix cannot contain spaces"; | ||
} | ||
if (isAlphanumeric) { | ||
return "> Prefix cannot be alphanumeric."; | ||
} | ||
if (args.startsWith("#")) { | ||
return "> Prefix cannot start with a `#`."; | ||
} | ||
if (args.startsWith("@")) { | ||
return "> Prefix cannot start with a `@`."; | ||
} | ||
ArrayList<String> prefixes = command.guildConfig.getXPDeniedPrefixes(); | ||
ListIterator iterator = prefixes.listIterator(); | ||
while (iterator.hasNext()) { | ||
String prefix = (String) iterator.next(); | ||
if (prefix.equals(args)) { | ||
iterator.remove(); | ||
return "> Removed the **" + prefix + "** prefix from the xp denied prefixes."; | ||
} | ||
} | ||
prefixes.add(args); | ||
return "> Added the **" + args + "** prefix to the list of xp denied prefixes."; | ||
} | ||
|
||
@Override | ||
public String[] names() { | ||
return new String[]{"DenyXpPrefix"}; | ||
} | ||
|
||
@Override | ||
public String description() { | ||
return "prefixes added to this list will stop commands starting with the prefix to stop xp gain."; | ||
} | ||
|
||
@Override | ||
public String usage() { | ||
return "[Prefix]/List"; | ||
} | ||
|
||
@Override | ||
public String type() { | ||
return TYPE_ADMIN; | ||
} | ||
|
||
@Override | ||
public String channel() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public Permissions[] perms() { | ||
return new Permissions[]{Permissions.MANAGE_SERVER}; | ||
} | ||
|
||
@Override | ||
public boolean requiresArgs() { | ||
return true; | ||
} | ||
|
||
@Override | ||
public boolean doAdminLogging() { | ||
return true; | ||
} | ||
|
||
@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]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
package Commands.Admin; | ||
|
||
import Commands.CommandObject; | ||
import Interfaces.Command; | ||
import Objects.UserTypeObject; | ||
import sx.blah.discord.handle.obj.Permissions; | ||
|
||
import java.text.NumberFormat; | ||
import java.util.ArrayList; | ||
import java.util.ListIterator; | ||
|
||
public class PruneEmptyProfiles implements Command { | ||
|
||
@Override | ||
public String execute(String args, CommandObject command) { | ||
ArrayList<UserTypeObject> profiles = command.guildUsers.getUsers(); | ||
UserTypeObject defaultProfile = new UserTypeObject(null); | ||
long profileCount = 0; | ||
ListIterator listIterator = profiles.listIterator(); | ||
while (listIterator.hasNext()) { | ||
UserTypeObject profile = (UserTypeObject) listIterator.next(); | ||
boolean noXP = profile.getXP() == 0; | ||
boolean noGender = defaultProfile.getGender().equals(profile.getGender()); | ||
boolean noQuote = defaultProfile.getQuote().equals(profile.getQuote()); | ||
boolean noSettings = profile.getSettings().size() == 0; | ||
boolean noLinks = profile.getLinks().size() == 0; | ||
if (noXP && noGender && noQuote && noSettings && noLinks) { | ||
listIterator.remove(); | ||
profileCount++; | ||
} | ||
} | ||
return "> " + NumberFormat.getInstance().format(profileCount) + " empty profiles pruned."; | ||
} | ||
|
||
@Override | ||
public String[] names() { | ||
return new String[]{"PruneEmptyProfiles"}; | ||
} | ||
|
||
@Override | ||
public String description() { | ||
return "Prunes all of the empty users on the server."; | ||
} | ||
|
||
@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_SERVER}; | ||
} | ||
|
||
@Override | ||
public boolean requiresArgs() { | ||
return false; | ||
} | ||
|
||
@Override | ||
public boolean doAdminLogging() { | ||
return true; | ||
} | ||
|
||
@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]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.