Commit Graph

444 Commits

Author SHA1 Message Date
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
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
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
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
5edb2e4cc8 added command to set config double to a certain value, added command to scale the exp (separately)
renamed multiplier property, to be more descriptive
2020-04-12 23:46:36 +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
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
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
20b282584a added command to add/remove channels from channel groups
added storing the commands with their modules in the db
renamed command impl module
2020-04-04 17:09:28 +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
Sheldan
d3a9a7a9f0 added embed support fo message deleted and message edited
added attachment support for message deleted
added imageUrl support to embed templating
2020-03-20 21:20:14 +01:00
Sheldan
ff29edbdac added logging of message deleted 2020-03-20 19:57:19 +01:00
Sheldan
35f976aaa4 added message caching
added message edited log (simple)
2020-03-20 18:48:20 +01:00
Sheldan
9b7f0743fc upgraded spring boot starter version
added gson dependency
added logging the exception in the exception post executor
added configuration exception in case the configuration for posttargets is not correct
added support to send embeds to posttargets
changed interface to be a warnlog instead of a server context for warning users, because the template
changed freemarker Incompatible Improvements to support default methods in interfaces
added ability to define embed configurations to be used, in order for a template to only be configurable as a template
changed template content size to 4000 characters
2020-03-20 16:06:19 +01:00
Sheldan
c978c1c677 changed context handling for command models for logging
added method to convert the user initiated context to a concrete command model
added method to find if a template exists
added method to render a context aware model
added banid command
2020-03-20 09:34:37 +01:00
Sheldan
ec21305725 added conventions for templated commands, to reduce the amount of necessary configuration
added an exception, in case the command was missing the correct types of parameters (channel is required, no channel was found)
added fix text to exception handler, in case the message of an exception is null
fixed off-by-one error when searching the missing parameter
changed supported chanel from guildChannel to textChannel for posttarget
added slowmode command
2020-03-18 21:06:27 +01:00
Sheldan
9119d57108 added kick command, made ban reason optional 2020-03-18 19:25:49 +01:00
Sheldan
bd848d31d3 added warn and ban command
changed command context to be a member instead of user, commands are only supported within guilds
added custom exception templating for the error message
added error message in case the parameters for a command were too little
added support for templates on command help descriptions
added post execution to be executed to print exception messages
refactored command handling to be able to support exceptions
added user and userInServer management
2020-03-18 18:21:06 +01:00