Commit Graph

242 Commits

Author SHA1 Message Date
Sheldan
e4efc26740 added templates parameters for help 2020-05-14 18:53:09 +02:00
Sheldan
4c826676d0 pulled some more user facing strings into templates 2020-05-14 00:49:57 +02:00
Sheldan
b591ae497d added more specific exceptions 2020-05-13 23:46:58 +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
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
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
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
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
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
cf713cc561 added unremind command 2020-05-01 23:24:05 +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
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
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
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
ff8817f765 added duration field to reminder and restructured remind text
added general duration formatting to freemarker (its a builtin method currently
added source channel attribute to starboard post
added exception logging to immediate reminders
2020-04-21 21:54:47 +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
e84e384706 added ability to define and use default emotes (introduced them in starboard/embed deletion/command reactions/suggestions)
fixed post target validation for suggestions
2020-04-10 11:24:16 +02:00
Sheldan
ef8dcb61d9 added reminders command
fixed embedbuilder list not containing an initial embed builder
2020-04-08 16:22:58 +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
523aaaae2a added ability to delete embedded posts (only the author and the person embedding can delete them) (this requires the embeds to be stored, they are deleted if the embed is deleted)
added filter to only handle reactions not done by the bot
introduced completable future to the delete message wrapper
fixed multi embed handling always resulting in two embeds
added logging of template exceptions
refactored link embed handling to be in a service instead of the listener
2020-04-07 22:32:56 +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
Sheldan
4b3765ee0f restructured core module 2020-04-04 18:19:24 +02:00
Sheldan
9b46f8d187 moved commands into the core, because its a core functionality 2020-04-04 18:08:55 +02:00
Sheldan
bf94af66d5 reworked exception handling, different exceptions whether or why it failed, all of which are unchecked
added feature flags for commands/listeners
added enable/disable command
added feature flag handling to command received handler
added boolean parameter support
fixed 1 parameter commands
fixed posttargets not working on multiple servers, removed unique constraint on posttarget names
added setup validation to suggestions
added quartz property loader
moved join/leave logger to moderation
reworked the way the message listener are handled (separate listener around)
2020-04-04 12:55:01 +02:00
Sheldan
c9557fccc2 added configurable warning and success reactions
changed that channels dont actually get deleted, but rather with a deleted flag, so the foreign keys are valid
added more optionals to server/channel/message/member retrieval
added throwing exceptions instead of just returning null
fixed filtering of deleted channels while the bot was offline
fixed channel listener
added message deleted listener structure
moved quartz properties to general application properties, because they were not found in the separate one
added try catch to reminderJob, so that the job is not in an invalid state
we now completely remove the starboard post, in case it falls under the threshold
added code to 'ignore' a staroard post form further stars, in case the post in the starboard gets deleted
now actually setting the reminded flag on a reminder
added handnling in case the channel to remind in does not exist anymore
2020-04-01 23:46:28 +02:00
Sheldan
089862bf15 added starboard functionality (starboard/starstats)
added module to store/retrieve configuration (double and string values)
replaced a few null values with optionals (emote loading)
fixed creating channels on startup
added delete message/get emote utility to bot service
extended emote service to have utility methods to use emotes
added reactions to message cache
added empty message handling to  post target service, in case the template evaluates to empty
added ability to edit a message in a post target (standard message and embed)
added principle of config listeners, so default config can be created, for example starboard thresholds
added abstract reaction listeners for adding/removing/clearing
fixed foreign keys between channel and server
added emote utils to handle AEmote and Emotes
renamed emotes to be camelCase, so they are easier to type
2020-04-01 14:16:04 +02:00
Sheldan
03e81a025b added scheduling support
added remind command
added support for parameters with spaces (they are contained by ")
fixed support for remainder parameters
added maxlength support for parameters
added ability to embed templates, to have a text as well
moved properties to a more appropriate position
added method do parse a duration
2020-03-28 20:12:59 +01:00
Sheldan
7d63f6b8af added some utility methods to bot service
reworked message cache to not be jda messages, but own objects: cachedMessages, jda messages should not be kept around
added listener to listen for message links, to represent them in an embed (or embeds)
added offsetDateTime handling for gson
introduced a way on how to handle async transaction handling for suggestions and message loading (self reference with another method with transactional)
added timestamp support to embeds
2020-03-24 20:36:36 +01:00
Sheldan
8cd9068cfc added error message logging to reaction post execution
added validation to post target command
added templates for post target command
moved ping and echo model to interface
added show emote command
2020-03-22 12:34:52 +01:00
Sheldan
d95382b589 added mechanism to dynamically load properties defining postTargets and valid emoteNames
changed the output of the exception message
refactored emote management service
added service to define whether or not an emote is usable by the bot
2020-03-22 10:26:58 +01:00
Sheldan
9e9eb615c0 added dynamic post target loading
fixed some templates of commands
added fat jar maven config
2020-03-21 18:39:46 +01:00
Sheldan
df0c156743 added utility module
added ability to create/accept/reject suggestions them
made commands async, because a lot of operations behave like that
in case the database is needed in an async operation, this needs to be in a separate transactional service
fixed ordering of Long parameters (server > channel > message)
added initial emote handling (no adding of emotes yet)
fixed creation of AUserInAServer, in case the user did not exist yet, when loading
changed PostTargetService to return Futures instead of being a void, in order to be able to act on the message posted
set logging level to debug
fixed help for different commands (templates had wrong naming)
2020-03-21 14:31:59 +01:00