643 Commits

Author SHA1 Message Date
Sheldan
3bb6620cbe added a condition to check for the correct feature mode
merged mod mail logging back into the mod mail feature and set it up as a mode
2020-05-16 22:40:11 +02:00
Sheldan
b0ab88d143 added setMode to documentation, added error handling with templated exception for set mode and refactored some feature config related methods (changed the equal to be case insensitive) 2020-05-16 21:46:10 +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
82c63d4825 added validation for emotes to features 2020-05-15 20:31:16 +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
3f6d980c4c added template for command not found, when disabling a command in a group 2020-05-14 01:02:31 +02:00
Sheldan
4c826676d0 pulled some more user facing strings into templates 2020-05-14 00:49:57 +02:00
Sheldan
40731157f7 restructured template config layout
moved some exception messages from module templates to template config
2020-05-14 00:28:50 +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
cb1abaed7d moved some more templates to template config
fixed usage of post target exceptions
2020-05-13 17:45:55 +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
1634f5e9cc fixed link embedding not properly working with sessions 2020-05-12 08:59:08 +02:00
Sheldan
5639ca20b5 added check to not allow two channel groups with the same name 2020-05-12 00:55:45 +02:00
Sheldan
59c449f4d3 added evaluation of the allowed commands when executing help
added a note that a few commands are only available within a mod mail thread
2020-05-12 00:45:13 +02:00
Sheldan
6b37b9e8b7 merged the config commands into one command for setting the appropriate value 2020-05-11 15:39:11 +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
860aa0eed7 added ability to configure paginators to be used
added paginator for warnings command
2020-05-09 21:31:31 +02:00
Sheldan
da8fea34da replaced a bunch of places where the database loaded objects were referenced across threads, this might have lead to problems when lazy loading them
fixed starboard post template
fixed starboard post deletion
2020-05-09 16:15:07 +02:00
Sheldan
8db1cead57 fixed some catch blocks to include all exceptions
fixed message sending undo action
2020-05-09 01:32:09 +02:00
Sheldan
0e7add826b added undo logic to mod mail logging
added some more logging when closing the mod mail thread
2020-05-09 01:10:46 +02:00
Sheldan
379db1ff73 added concept of undo actions
used undo actions to delete the mod mail thread channel, if it already reached a certain state when initially setting up the mod mail thread
2020-05-09 00:19:19 +02:00
Sheldan
271ea7364a fixed initial setup for mod mail category
fixed setup for locking
added exception message in case the modmail post target is not defined
2020-05-08 23:22:23 +02:00
Sheldan
d1f307837d added initial setting for the mod mail category in a listener, so it can be configured via command 2020-05-08 18:27:04 +02:00
Sheldan
9fdca52005 added command to remove the role from mod mail configuration again
added convenience method to disallow a whole feature for a role
2020-05-08 12:11:35 +02:00
Sheldan
7699075b33 added mod mail thread notification, if a user initiates a mod mail thread
added the concept of a mod mail role, these are roles being pinged when a thread is opened, and they also are able to execute mod mail related commands
fixed past thread count in mod mail header
added convenience method to allow a role to execute a whole feature
2020-05-08 10:49:06 +02:00
Sheldan
ea6fe240f4 added anonymous message handling to modmail 2020-05-08 00:58:05 +02:00
Sheldan
c03788a065 added closesilently command for modmail
largely refactored modmail future handling and error handling in case:
no permission, unable to contact user
fixed help command template
2020-05-08 00:20:20 +02:00
Sheldan
cb1a14e46b added user facing message in case the initial modmail creation fails 2020-05-06 23:41:35 +02:00
Sheldan
feb9ce07ee fixed using the correct parameter for reply and anon reply (not the whole message, so we dont need to parse out the actual reply again)
added optional note parameter for close
fixed state not being saved in database for mod mail thread
changed logging of mod mail to be templated, instead of replaying the messages
added reaction to indicate the user, that the message was processes by modmail
fixed future handling for user message replies (we blocked)
added header for initial information about the user when he opens a thread
fixed duration formater resulting in new lines
2020-05-06 23:22:43 +02:00
Sheldan
ad1cbb54fd refactored the naming in channel service
added initial version of closing and logging the thread
2020-05-06 18:32:08 +02:00
Sheldan
a06006d763 added jda utilities dependency
added modmail with some simple features (chat between user and moderator), and initial server selection (currently allows all servers, and does not consider the modmail feature)
added the initial commands, not all of them hold logic currently
added some checks to not crash when a command has null configuration
changed systemconfig to also have a long value, because double is not fit for all cases
added locking mechanism, to effectively lock the whole table without using the ... proper locking mechanism (needs to be reviewed)
changed interface in channel service to be a message channel instead of a textChannel
changed starboard post to be a user in a server instead of only user
2020-05-06 14:17:44 +02:00
Sheldan
70365ca556 added logging to several places concerning futures 2020-05-01 22:56:21 +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
85c47db5ed allowed the Arole parameter type to be either an id or the role mention
fixed adding/removing allowed roles, the compare did not work
changed a few commands to use the Arole parameter
2020-04-28 22:12:29 +02:00
Sheldan
6ed3a133e2 added allowed roles, immune roles and restriction status to help command 2020-04-28 21:32:20 +02:00
Sheldan
65b693be7b added alias support to help command 2020-04-28 20:22:27 +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
93f587bf26 refactored help command 2020-04-28 15:39:47 +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
05aa0815d6 added feature to dynamically adapt the prefix while the bot is running, multiple characters are supported 2020-04-26 12:11:28 +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