The whole idea with this update is to reduce the size of the main FlareBot class and make everything more maintainable
- Group methods together to make finding methods easier
- Document all util methods with JavaDoc comments
- Organise classes to make sure all fields and methods are in correct place
- Separate all strings out into JSON
Instead of a "Default" group, just check for if the perm is default and execute it. This will work with the negative permissions which I want to add as well, they can just make a group and negative a permission. Benefit of this is we don't need to worry about adding new perms.
Enum to hold all permissions, allows permissions to be listed while still keeping the dynamic nature described. Also allows permissions to be validated.
public Permissions(String perm, boolean default)
- Default constructorpublic Permissions String perm, Class<? extends Command> command, boolean default)
- Used for linking command specific permsPermissions.<PERMISSION>.hasPermission(Member member, GuildWrapper wrapper)
- Checks permission taking into account default and negation perms
-
Move config into manager
- Non static, instance based manager
-
Move all command logic and registering into a new class
- "CommandManager"?
-
Move util methods to a util class
- getInvite
- getVersion
- getMessage
- formatTime
- getDayOfMonthSuffix
-
Make a constants class
- Methods
- getOfficialGuild
- getImportantLogChannel
- getErrorLogChannel
- getGuildLogChannel
- getEGLogChannel
- Constants
- INVITE_URL
- COMMAND_CHAR
- OFFICIAL_GUILD
- FLAREBOT_API
- DEVELOPER_ID
- CONTRIBUTOR_ID
- STAFF_ID
- FLARE_TEST_BOT_CHANNEL
- Methods
-
Reorganise FlareBot.java to have all fields at the top
-
Move "getters" to a separate class
- getVoiceChannels
- getActiveVoiceChannels
- getChannelByID
- getGuildByID
- getGuilds
- getChannels
- getConnectedVoiceChannels
- getUsers
- getUserByID
- retrieveUserByID
-
Group events based on type of thing they are acting on (Guild, Message, Member, etc..)
-
Add javadoc comments to all methods detailing what they are used for and what class they are linked to if any. This doesn't have to be a full JavaDoc comment, it just needs to describe the function of the method.
-
Rename "handle" methods to something more appropriate
- Avoid using handler methods where appropriate
-
Group all getters
- Comment methods (JavaDoc)
- Make time needed to confirm flexible?
- Either change expirymap logic to allow
purge(boolean force, long time)
- Or make a map of expiry maps, could get very messy
- Either change expirymap logic to allow
- Group by type of util (Messages, Parsers, Converters, etc...)
- Comment methods (JavaDoc)
- Move stuff like this
- Move prefixes into GuildWrapper
- Make a class to handle git (versions and commit hash etc)
- Set sentry release to commit hash