Commit graph

79 commits

Author SHA1 Message Date
Noi
785e69773e Fix exception thrown when given valid role 2022-08-23 20:12:39 -07:00
Noi
64bea79ef7 ModLogEntry: Add composite foreign key reference 2022-08-23 19:57:04 -07:00
Noi
7b29753290 Update entity classes
EntityList's `enforceTypes` setting was removed, as EntityName
enforced entries being unambiguous anyway.
Added a way to enforce specific types on instantiation or else
throw an exception, and updated all existing uses requiring that
check accordingly.
2022-08-22 21:14:09 -07:00
Noi
b4db1fcff8 Implement SharedEventService; remove cache update event 2022-08-17 16:59:30 -07:00
Noi
4f896e8311 Implement moderation logging to database
Further commits will implement a system to propagate these logs,
allowing modules and services to act on them regardless of their origin.
Additionally, further commits shall implement these changes within
built-in modules to allow for their immediate use.
2022-08-16 12:37:06 -07:00
Noi
a419dd2554 Separate code files between feature sets 2022-08-15 20:18:14 -07:00
Noi
e9178bc149 Improved logging and minor fixes 2022-07-28 19:33:49 -07:00
Noi
0ef78a53dc Rewrite VoiceRoleSync
Implement a slightly more sane configuration
2022-07-28 19:05:24 -07:00
Noi
2d4ae0b4a8 Switch logging to local time 2022-07-28 14:31:36 -07:00
Noi
ffded1b45c Add initial migration 2022-07-28 14:10:35 -07:00
Noi
0f15666810 Add attachment information to message logs 2022-07-28 14:10:07 -07:00
Noi
724f35fea6 Remove extraneous comments and reminders 2022-07-28 14:09:52 -07:00
Noi
52d3b1b9d4 Update default example configuration file 2022-07-28 14:08:23 -07:00
Noi
8317f09b04 Fix issues when handling 'bad' message update data
See comment in MessageCachingSubservice.
2022-07-27 22:02:17 -07:00
Noi
bbe0a84532 Add logging for long-running task 2022-07-27 22:00:10 -07:00
Noi
ebdaa6482c Remove 'report' option in logging
The feature was previously meant for monitoring errors in a large public
bot instance, but is massively redundant and even annoying when using
as a self-hosted instance.
Besides, the information it did report was excessive and of little use.
2022-07-27 19:23:49 -07:00
Noi
c77e4bd579 Update DB model: message content may be null
Additionally, removed existing migration data for now. Will re-add
when the project is nearly ready for a proper release.
2022-07-27 18:05:52 -07:00
Noi
8e05a00136 Fix list filtering and matching issues 2022-07-27 18:03:12 -07:00
Noi
584a55cd60 Always load database config at start
Ensures that the database settings used by ef tools are those in config.
2022-07-22 23:41:49 -07:00
Noi
c3ecf2a877 Update initial database model and migration 2022-07-20 20:37:31 -07:00
Noi
fc88ab5cf9 Update modules and module loading
Changed accessibility of included modules to 'internal'
to suppress documentation warnings.
Additionally, increase logging feedback as configuration is loaded.
2022-07-20 20:35:26 -07:00
Noi
1149f2800d Reorganized project
Moved modules into the assembly itself to simplify development of
further features and reduce complexity in building this project.

Additionally, many small adjustments were made, including:
- Add documentation to most public methods that had it missing
- Minor style updates
- Updated readme to reflect near-completion of this rewrite
- Remove any last remaining references to old project name Kerobot
- Update dependencies
2022-07-20 18:55:08 -07:00
Noi
53e0301edd Add ModCommands module 2022-07-18 16:44:31 -07:00
Noi
681bb1c345 Capitalize default FilterList keys 2022-07-18 16:18:05 -07:00
Noi
dc61e93a7f Fix ping-like query failing; other small changes 2022-07-12 23:45:18 -07:00
Noi
9e09800bff Remove unused, confusing property 2022-07-09 13:25:52 -07:00
Noi
a16354e425 Change exception handling to null checking 2022-07-09 13:25:52 -07:00
Noi
2f823a3730 Reorganize commonly used code 2022-07-09 13:25:52 -07:00
Noi
f8fe48766b Add ModLogs module
Very similar in function to legacy's ModLogs, but with far cleaner code.
Additionally fixes some EC issues regarding the message update delegate.
2022-07-08 12:03:15 -07:00
Noi
08afc224ed Port VoiceRoleSync from legacy
Since it was recently rewritten, the code was copied over nearly as-is from
the legacy branch without any other major changes considered.
2022-07-05 21:53:00 -07:00
Noi
2dafdf07db Replace redundant code with new common function 2022-07-05 21:01:30 -07:00
Noi
ffaae04bc6 Rewrite RegexModerator 2022-07-05 20:59:19 -07:00
Noi
13324999cc Updates and changes to project files
- Set up vscode tasks
- Update Readme and License
- Minor style and documentation changes
2022-06-18 00:05:12 -07:00
Noi
2160b0fa4e Have AutoResponder use similar config format to RegexModerator 2022-06-18 00:05:12 -07:00
Noi
6032e4d37b Shorter message in notification if no reason given 2022-06-18 00:05:12 -07:00
Noi
6afa6dc2c6 Fix several database issues
- Specify default value
- Cache all guild users on initial download
- Fix foreign key constraint issues
2022-06-18 00:05:12 -07:00
Noi
da31ce3e0d Add common incoming message check, fix auto role entry 2022-06-18 00:04:11 -07:00
Noi
94d4a27e85 Change build settings, fix minor problems 2022-06-18 00:01:42 -07:00
Noi
e1a39f964f Simplified logging, added logging to file 2022-06-18 00:01:42 -07:00
Noi
8d081ed637 Fix database issues; create initial EF migration 2022-06-18 00:01:42 -07:00
Noi
5671b7b48c Add message caching subservice
Partially implements legacy's ModLogs module on the bot side, with the remainder to be implemented as a proper module.
2022-06-18 00:01:42 -07:00
Noi
4f773e2573 Begin module rewrites and ports 2022-06-18 00:01:13 -07:00
Noikoio
02f91947f3 Add Entity Framework, update services
Add EF; port EventLoggingService to it

Update CommonFunctions: new style, some tweaks

Update user caching subservice

Update GuildStateService

- File-based only. Removed incomplete database support.
- Removed hooks within client; ModuleBase has direct access now
- Removed checks based on time-based staleness
- Code and style updates on all affected files

Style and nullable updates

And some minor structural changes here and there

Rewrite LoggingService

- Remove database-backed instance log
- Make logging methods synchronous
- Change instance reporting to webhook-based

Update ModuleStateService and related code
2022-06-18 00:00:43 -07:00
Noikoio
a7de9132ed Abandoning old plans, project will continue as RegexBot 3.0 2022-06-17 23:53:27 -07:00
Noikoio
6b83735d6b Rename LoggingService to EventLoggingService
Renamed to differentiate between upcoming UserLoggingService.
2019-06-22 17:12:05 -07:00
Noikoio
ffa5b5754b Several fixes after a round of testing
Fixed the following compilation errors:
-Moderators collection not initialized
-Outdated method signatures for ban and kick in ModuleBase
-Update author name in manifests
-Fixed incorrect method signature in AutoScriptResponder

Minor improvements:
-Updated external dependencies
-Remove unused variables in ConfDefinition of RegexModerator
-Improve parallel execution of matches?
-Send exception message on logging failure to reporting channel
-Slightly change ModuleLoader logging output
-Add Discord.Net unhandled exception output to logging
-Updated link to Github
-Changed GuildState exception handling message for conciseness

Fixes:
-SQL index creation in LoggingService
-SQL view creation in UserCacheService
-Add casts from ulong to long in SQL inserts
-External modules no longer loaded twice
-Non-Info messages from Discord.Net will now be reported
-User data had not been recorded at proper times
-Some modules had been returning null instead of Task with null
-Guild state exception handling should not have handled config errors
2019-06-21 15:05:58 -07:00
Noikoio
2319c91fc7 Switch to file-based configuration 2019-06-21 14:32:20 -07:00
Noikoio
c1e8f6699a Moved EntryRole to self-hosted
As it's currently implemented, it may cause problems for larger guilds
if any error is encountered. Additionally, it requires that the bot keep
tabs on all users on entry which may bring unnecessary extra load on the
host.

Additionally, added some error handling.
2019-06-20 17:35:50 -07:00
Noikoio
90feeb47b0 Ported RegexModerator from RegexBot
Changes:
-Renamed from AutoMod
-Some options have been simplified to reduce complexity
-Response exectution has been totally reworked to accomodate new and
upcoming features

Currently untested.
2019-06-16 22:37:11 -07:00
Noikoio
e87a985067 Finish adding entity finder helper methods 2019-06-16 21:59:17 -07:00