Commit Graph

269 Commits

Author SHA1 Message Date
Sheldan
552ecc26b8 [AB-99/AB-66] changed commands to use embeds for exceptions instead of direct messages
added models instead of using HashMaps for exceptions
added a lot of exceptions for different cases
refactored a few commands to be fully async instead of fire and forget
2020-08-29 12:55:48 +02:00
Sheldan
fd4d784081 added assignable role place module including: setting up, configuring, deleting commands and documentation
upgraded JDA version to 4.2.0
refactored multiple interfaces to be more convenient/contain more information (reaction added/removed now gets the actual event)
added generic way to check for conditions. these conditions are provided by modules and are loosely connected via condition context and a condition name
added changeable flag to emotes to indicate that they can be updated via setEmote
refactored emote parsing in command parameters, the command parameters will now contain a fake emote
added feature to embed templates for fields to force a new message regardless of the discord limit
added some more functionality to message and channel service regarding field edit/embed sending
introduced the full emote parameter, to have both the emote (if custom) and a fake aemote at hand
refactored some methods to already throw exceptions within the retrieval methods, instead of optionals which need to be dealt outside
changed getEmotes to getEmotesBag to have duplicates of emotes
fixed setEmote to behave correctly with new parameter types
fixed creation of emotes, which previously created additional instances
fixed templating multiple fields handling
refactored command handling to allow async commands, they are the same interface, but configuration dicates whether or not it is async
added generic exception reporting for async commands
refactored a bunch of service methods to be named optional, and the non optional methods throw exceptions in case nothing is found
added a few more customized exceptions
added clearing freemarker internal template cache to clear cache
added feature to skip, not use, embeds if they look to be empty (no fields, no description, no attachment)
added virtual env to gitignore
fixed initial sync of roles un-marking roles as deleted
added some convenience methods to remove reactions from users directly
fixed post command handling in case it is not a templatable instance
fixed exceptions without cause in generic exception model
2020-08-12 20:01:15 +02:00
Sheldan
9374dfb912 added liquibase for setup of databases and initial values
fixed some table names to be singular
migrated templates to separate repository
added seed data to initial version in liquibase migrations instead of property files (post targets, emotes etc) and created some default tables containing those default values
added separate artifacts to be used containing only the liquibase config
added shell script as a wrapper for ansible deployment, to handle an environment variable defining whether or not the deployment should be executed
added logback scan period
added licenses for ansible, liquibase, docker and docker-compose
2020-07-17 21:48:23 +02:00
Sheldan
e8767429bf update JDA and jda Utilities version
fixed typos in the code
2020-06-28 12:04:34 +02:00
Sheldan
c44eb80fc5 added message to user initiated context
fixed templates for ban and kick logging
refactored kicking service
fixed guild not found exception template
added command validator to be used for unit testing commands
added default values for command configuration
changed some interfaces to message channel instead of text channel
added separate executor service for un-mutes, which is shared
updated spring boot version to 2.3.1
removed database connection string from properties
added logback configuration
changed some future logic in purge
refactored error message for un mute, when there is no active mute
refactored listener interface and removed usage of context utils
added tests for moderation services
2020-06-28 11:13:56 +02:00
Sheldan
1091e66013 added purge command to delete messages via bulk delete
adapted api of status message service
added concept of self destruct command results, these will cause the command message to be deleted
2020-06-03 19:47:50 +02:00
Sheldan
3fa5edf67a addressed sonar code smells 2020-05-27 19:38:43 +02:00
Sheldan
de4eeeacca added serverInfo help
added userInfo command
added offsetDateTime to the custom date formatter
2020-05-27 15:10:54 +02:00
Sheldan
3714fd2582 added default value handling to setup wizard
added table to store the default values of the whole system, to not require the property files
added ability to cancel setup wizard
2020-05-22 20:13:24 +02:00
Sheldan
992357b2cb added setup command which includes an interactive process in order to setup features
the current supported features are post targets and system config
the wizard includes a summary step where the user can confirm the changes
removed some unnecessary validators, which were basically just validating the system config from some features
fixed post target name
2020-05-22 17:25:44 +02:00
Sheldan
1e667686d3 introduced *all* intents abstracto requires in order to function...., because with the new version the guild members intent was not used, and various features were not functioning
added initial message also to be send
2020-05-20 00:31:43 +02:00
Sheldan
20f8e422a2 added commands to create/delete/list usernotes 2020-05-17 23:13:01 +02:00
Sheldan
d2264937b2 added the concept of feature modes, these are the modes in which a feature can operate, its basically a separate way how the feature does it jobs, for example mod mail might log or it might not. bot of these are different modes
refactored services for feature flag and feature config
2020-05-16 20:55:13 +02:00
Sheldan
d5007e362b added support for example templates/direct strings to commands who need it
added example templates for some commands
added the examples to documentation as well
2020-05-16 01:20:23 +02:00
Sheldan
ddb540ccfe added columns for tracking created/updated 2020-05-16 00:21:53 +02:00
Sheldan
b984129df6 added check for existing system config when a feature is enabled 2020-05-15 18:53:51 +02:00
Sheldan
f11232de05 moved post targets to an enum, in order to have more type safety, this might be changed in the future
added validation check when a feature is enabled, in order to notify which configuration is missing for this feature to function properly
2020-05-15 17:43:39 +02:00
Sheldan
e4efc26740 added templates parameters for help 2020-05-14 18:53:09 +02:00
Sheldan
cf04687f04 moved some more exceptions to templates
made more specific exceptions for certain cases
2020-05-13 23:25:52 +02:00
Sheldan
80505d1014 migrated some exceptions to use templates
fixed missed hard coded value in template
fixed listing of channels in channel groups
fixed template loading
2020-05-13 17:04:21 +02:00
Sheldan
c429aa882b refactored channel exception to have a unified interface to form the exception message
replaced getOne with findById in order to get optionals and handle those
some places still have the general abstracto run time exception
2020-05-13 12:49:08 +02:00
Sheldan
5755d033eb fixed command and feature mapping
added a bunch of java doc to moderation interface
added check in case the text channel on the server was deleted while the mod mail thread was still open
This now returns an error to the user side and prompts to message the bot again in order to create a new mod mail thread
2020-05-12 22:44:44 +02:00
Sheldan
8d8f735672 fixed future handling in message cache, so methods return futures instead of requiring them as parameters
and adapted the code using this
fixed config loading still relying on double, where the values were changed to long
2020-05-12 09:32:18 +02:00
Sheldan
b13309a026 Split the logging of mod mail threads to a separate feature
fixed the default values of features in properties files
2020-05-11 16:15:02 +02:00
Sheldan
af15becf84 fixed the type of initial values for configuration 2020-05-11 15:42:54 +02:00
Sheldan
9197fe0268 removed decay feature boolean from myWarnings, because only automatic decay is an additional feature
fixed post target for kicking
fixed casing for mod mail post targets
added initial version of the ascii doctor documentation
2020-05-11 15:00:00 +02:00
Sheldan
ba032194ce added bean configuration for event waiter to be used for paginator
fixed initial setup for server
fixed command in a server configuration
2020-05-10 20:29:32 +02:00
Sheldan
82186c8757 added command to delete a warning by id 2020-05-10 19:34:35 +02:00
Sheldan
860aa0eed7 added ability to configure paginators to be used
added paginator for warnings command
2020-05-09 21:31:31 +02:00
Sheldan
1e203c19e0 added command to check your own commands 2020-05-09 17:19:09 +02:00
Sheldan
f2ce402256 introduced eh-cache as a caching provider instead of caffeine to be used in hibernate (only ram cache is currently possible)
added caching configuration for 2nd level caching in hibernate
added command to clear hibernate caches
changed some interfaces so the api looks a bit more consistent (return the created/updated value)
split user management and user in server management
added try catch block to message received listener execution, to make them independent
moved some feature flag methods to the feature flag service bean instead of the management service, as they used the FeatureEnum directly
fixed feature disable text always rendering
removed some non embed logging
fixed message embed template
added exception logging to message embedding
2020-05-01 22:42:12 +02:00
Sheldan
59dc8c602a refactored command responses to use a central place for configuration in an extra module
fixed makeAffected role parameter
made command check name case insensitive
added name to parameter for decayAllWarnings
removed simple log from message edited listener
2020-04-30 22:29:49 +02:00
Sheldan
d5482fabd4 renamed feature display to feature config
added concept of feature dependencies, if one feature depends on another feature, and it gets enabled, the other feature is enabled as well
changed some feature related apis
added ability to automatically decay warnings (separate feature)
added command to trigger the warn decay manually
added command to decay all active warnings
added method to scheduler service to directly start a cron job
2020-04-29 21:25:26 +02:00
Sheldan
1fc459f65e added description/long help and usage to all the current commands and updated a few of existing ones
added help info objects to the commands who missed them
changed all commands to be templated and removed the hard coded strings to only rely on templates (other commands might only want to use the direct string)
fixed handling of null parameters/submodules in help command
fixed experience module not showing up in help command
2020-04-28 20:02:03 +02:00
Sheldan
8e7bc7d98f fixed some code smells 2020-04-27 20:23:02 +02:00
Sheldan
e08086b6a9 added the concept of commands in server, to have a separate config for commands within a server
added server config listener, to create such commands
moved the command and feature creation to separate spring listener (they are dependant, a mechanism for dependencies is needed)
added a feature flag to the command table, so we know what the feature of a command is
added ability to restrict commands to certain roles/remove the restriction
added ability to make some roles not affected by a command/remove the immunity, this works by retrieving the first member from the command parameters, and checking if the member has the said role
commands in a server now have a restricted flag to indicate, if the role checks should be in effect (only affects role-to-execute restriction)
fixed initial prefix config
added the immune user check only to commands most likely needing it
2020-04-27 17:32:33 +02:00
Sheldan
4800470f86 refactored features to be components instead, so we have more runtime config (for example template config etc), this can be done, because features depend on the code anyway and do not need to be done via property files, the property files only define the default values when starting up
fixed feature disabled message not being templated and refactored the way condition checks are handled by the command received handler, so we do not use exceptions for this, this handled by a specified state in the result and a separate post execution handler
added separate config module to the commands
added command to see which features are available, and their current state
fixed scheduler test
2020-04-26 11:38:27 +02:00
Sheldan
bd554537cc removed some unused autowired services
changed place to use the starboard post source channel instead of the message channel
2020-04-25 14:41:31 +02:00
Sheldan
7ac2f2ce08 added unmute command to end all mutes, and remove the current one, this also cancels all running jobs, so we need to store the triggers
enabled voice state cache, as its necessary for voice state operations
kick user out of voice chat, if they are in any
changed unmute date to the the effective date of the unmute, instead of the planned date
added possibility to stop a job via the trigger key
2020-04-25 11:10:59 +02:00
Sheldan
d4eeb2dadb added check to unmute user, in case the user left the guild
added checks if users being awarded a role are still in the guild
2020-04-24 20:49:06 +02:00
Sheldan
0f8a39a336 changed catch block in join listener for Exception, so the listener dont interrupt one another
fixed join template
added join listener to check if a joined user should be muted
changed cached message to be an intant instead
fixed wrong id in mute table
moved the timestamps for mute notifications to the footer
fixed a case for message embeds, when the embed does not have a description
2020-04-24 20:04:19 +02:00
Sheldan
b41a596acd added Arole to command received handler in order to handle it
restructured channel service calls a little bit
moved dm sending to message service
fixed log level configuration
added full user dto, to be used as a combination of a AUserInServer and Member, for operations which need both, to avoid converting and reloading the user
added mute command and mute role command
added mute table
added mute role table
added job to automatically unmute people at the given time period
restructured warn service
removed simple message log for warnings
added method to templating to support formatting instants
2020-04-24 18:02:05 +02:00
Sheldan
cf37d4adef added javadoc to experience tracking module
changed persistence configuration for entities, so cascade is more correct
changed the way channels get their server assigned
added feature to only change the exp role of a user, if he doesn't already have the new target role
added the name of the needed feature, to the message indicating that a feature has been disabled
updated unsetExpRole to have a status update message, because there might be a lot of users which need a role update
2020-04-23 23:39:05 +02:00
Sheldan
1a74924850 changed parameter for slowmode command to be a duration string instead of just seconds
added exception to duration parsing, in case there is a unknown duration indicator
2020-04-21 22:20:39 +02:00
Sheldan
7b56b89157 added check to check if a role is in the server
added more log output
2020-04-21 19:25:12 +02:00
Sheldan
edb270e887 added command to sync roles for the whole server
added command to remove a role from the experience roles
added leaderboard command
added rank command
fixed missfire configuration for cron jobs (they should not be executed)
added ability to configure recovery for jobs
added tracking of message count
added join listener to automatically give the appropriate role for a joined user
added parameter to join listener containing the userInAServer
re-added command exception templates
added method to create a status message (basically only a single message is returned and expected)
added method to edit a single message in a channel to channel service
fixed cases in which there are no embeds, but we still used the embed principle of sending messages (only text was send)
added more functions to channel service to send messages with
moved joined listeners to their separate transaction
2020-04-12 19:35:42 +02:00
Sheldan
6a31dfde8a added experience tracking and automatic role assigning at given levels
includes: set role command to set a role to a given level (it clears out previous levels)
automatic level config generation on startup
min/max/multiplier configuration
job to persist the xp of the previous minute
added delayed scheduler start, so that events have a discord context in order to function
added role listener to automatically add and mark roles when they are created/deleted
fixed user in a server not being created correctly
added role service to give users role given by id
added server reference to role
2020-04-11 17:21:55 +02:00
Sheldan
e13762fa02 renamed template method to not rely on overloading
added test for scheduler service bean
2020-04-08 13:26:37 +02:00
Sheldan
da28831ff9 restructured packages - aligned the whole project to use a similar package layout for classes with similar purpose
removed context aware template support
2020-04-07 23:27:48 +02:00
Sheldan
20cb43d071 added command to manage channel groups
added ability to disable command in channel groups
refactored embed handling to support multiple embeds to be send at once (handling to decide to split into multiple embeds is still needed)
2020-04-06 00:51:07 +02:00