Commit Graph

686 Commits

Author SHA1 Message Date
Ske
761270f0c3 Clean up member privacy command 2020-06-17 23:06:49 +02:00
Ske
e92700f339 Comment out color privacy stuff for now (revisit later?) 2020-06-17 21:51:40 +02:00
BeeFox-sys
721a4502bb
Feature/granular member privacy (#174)
* Some reasons this needs to exist for it to run on my machine? I don't think it would hurt to have it in other machines so

* Add options to member model

* Add Privacy to member embed

* Added member privacy display list

* Update database settings

* apparetnly this is nolonger needed?

* Fix sql call

* Fix more sql errors

* Added in settings control

* Add all subject to system privacy

* Basic API Privacy

* Name privacy in logs

* update todo

* remove CheckReadMemberPermission

* Added name privacy to log embed

* update todo

* Update todo

* Update api to handle privacy

* update todo

* Update systemlist full to respect privacy (as well as system list)

* include colour as option for member privacy subject

* move todo file (why was it there?)

* Update TODO.md

* Update TODO.md

* Update TODO.md

* Deleted to create pr

* Update command usage and add to the command tree

* Make api respect created privacy

* Add editing privacy through the api

* Fix pronoun privacy field in api

* Fix info leak of display name in api

* deprecate privacy field in api

* Deprecate privacy diffrently

* Update API

* Update documentation

* Update documentation

* Remove comment in yml

* Update userguide

* Update migration (fix typo in 5.sql too)

* Sanatize names

* some full stops

* Fix after merge

* update migration

* update schema version

* update edit command

* update privacy filter

* fix a dumb mistake

* clarify on what name privacy does

* make it easier on someone else

* Update docs

* Comment out unused code

* Add aliases for `member privacy all public` and `member privacy all private`
2020-06-17 21:31:39 +02:00
Ske
627f544ee8 Migrate API to ASP.NET Core Auth services + refactor 2020-06-16 01:15:59 +02:00
Ske
7fde54050a Avoid a blank overflow page when showing paginated cards (closes #171) 2020-06-15 13:00:28 +02:00
Ske
5280e48b09 Properly check ShowProxyTags when printing proxy tags 2020-06-15 12:55:02 +02:00
Ske
088bc15e5e Upgrade Autofac dependency 2020-06-15 00:52:20 +02:00
Ske
ca882dba73 Add more performance metrics 2020-06-14 22:19:12 +02:00
Ske
b9cbd241de Migrate to type-safe model ID structs 2020-06-14 21:37:04 +02:00
Ske
e5ac5edc35 Refactor and categorize tests 2020-06-14 20:22:29 +02:00
Ske
0f041c2e3c Add unit test project and some early tests 2020-06-14 18:56:53 +02:00
Ske
2d43c17f9e Add pk;member list as alias for pk;system list 2020-06-14 18:56:35 +02:00
Ske
c780781184 Remove unused imports 2020-06-13 23:12:44 +02:00
Ske
2702c45b4f General bits of cleanup 2020-06-13 22:20:24 +02:00
Ske
4b69ef806a Properly support KeepProxy after refactor 2020-06-13 22:16:04 +02:00
Ske
6d06474d26 Refactor sort/filter code once again
Now we handle sorting on the bot side, but still filter in the database
2020-06-13 21:49:31 +02:00
Ske
0bb8d2b917 Add own member checks back to the avatar mutators 2020-06-13 20:23:06 +02:00
Ske
f1b28b7fb6 Move schema migration stuff to Database 2020-06-13 19:54:16 +02:00
Ske
c927967c3b Migrate GetSystemById 2020-06-13 19:42:04 +02:00
Ske
90ac186183 Extract Database to interface 2020-06-13 19:36:43 +02:00
Ske
1c2ebdc658 Fix proxy blacklist command 2020-06-13 19:19:13 +02:00
Ske
c875c8af9f Various small fixes, setting guild config now works 2020-06-13 19:15:50 +02:00
Ske
2038f023a0 Move count stat collecting to raw SQL 2020-06-13 19:15:29 +02:00
Ske
e176ccbab5 Several more database-y refactors
- DbConnectionFactory renamed to "Database", will now be the primary entry point for DB stuff
- Created IPKConnection interface mostly containing async extensions to IDbConnection, use this going forward
- Reworked the Connection/Command wrappers (that have performance/logging extensions)
- Probably more stuff that I forgot???
2020-06-13 18:31:20 +02:00
Ske
a915ddb41c Extract system/member guild settings and refactor DB access
(also refactor MemberAvatar now that I'm here)
2020-06-13 16:03:57 +02:00
Ske
ed511a6236 Refactor server config models/commands 2020-06-13 13:58:27 +02:00
Ske
729930a562 Move system tag/icon from ProxyMember to MessageContent 2020-06-12 23:30:10 +02:00
Ske
3d62a0d33c Split message/proxy data up in MessageContext and ProxyMember 2020-06-12 23:13:21 +02:00
Ske
ba441a15cc Too many refactors in one:
- Allowed adding ephemeral(ish) views and functions
- Moved message_count to a concrete database field
- Moved most proxy logic to a stored procedure
- Moved database files around and refactored schema manager
2020-06-12 20:29:50 +02:00
Ske
49acc4d9e2 Refactor proxy handling code
- Move reaction handlers to the ReactionAdded event instead of
  ProxyService
- Split tag matching off into ProxyTagParser
- Split autoproxy matching off into Autoproxier
- General cleanup and simplification
2020-06-11 23:22:53 +02:00
Astrid
4a4d980349
Merge pull request #177 from acw0/bugfix/tag-markdown
Properly show tags containing markdown in system embed
2020-06-11 21:35:28 +02:00
Ske
67e55736f0 Still remove the reaction even if pings are disabled 2020-06-11 21:33:44 +02:00
Ske
ccb6ba5d30 Minor renames and rewordings 2020-06-11 21:32:04 +02:00
Lillian Berry
59af6f02e8 Add disabling reaction pings 2020-06-11 21:19:40 +02:00
Astrid
216dfffe58
Merge pull request #181 from acw0/fix-emojis
Fix emoji variation selector issue
2020-06-11 21:13:07 +02:00
ariel w
82886fe9e2
Move discord links to new domain (#180) 2020-06-11 21:12:43 +02:00
Ske
3d69a00716 Fixed exceptions when fetching webhook list "sticking" in the cache
This happened because we cache Task instances, not the values, and a failed task is still a *valid* task that can repeatedly be awaited. This lead to the Task being saved even if it failed, and the same exception constantly being re-thrown.

This fix invalidates the cache if it finds a failed Task, and lets it retry fetching as normal (hopefully successfully this time).
2020-06-11 16:13:18 +02:00
Ske
e7191def02 Split long short-list results up into embed fields 2020-06-07 19:52:05 +02:00
Ske
c537dc7de3 Fix quotes in collate clause 2020-06-07 19:49:43 +02:00
Ske
1db46accce Potentially fix sort order with emojis 2020-06-07 19:31:41 +02:00
Ske
e347928c02 Merge branch 'feature/sort-filter' 2020-06-07 16:36:42 +02:00
Ske
1ac5f9518e Mostly finished, needs to be double-checked/documented 2020-06-07 01:30:19 +02:00
acw0
5714c18668 Fix emoji variation selector issue 2020-06-05 18:34:24 -04:00
Ske
e8068cc1a9 Add avatar credit for June 2020-06-04 16:24:30 +02:00
Ske
7c85dc360b Barebones, untested sort/filtering 2020-06-04 13:21:47 +02:00
Ske
d5c6e2baac Don't post an error after clearing avatar 2020-06-02 02:02:07 +02:00
Ske
ae74dce2ce Make sure we only attach shard listeners once 2020-05-31 03:19:42 +02:00
Ske
fbbbb51998 Upgrade DSharpPlus version 2020-05-23 01:59:27 +02:00
Ske
d657e9813d Properly handle executing missing webhooks 2020-05-23 01:51:02 +02:00
acw0
f55c638f41 Properly show tags containing markdown in system embed 2020-05-15 07:32:28 -04:00
Ske
792acad50a Don't try to parse webhook error if error isn't JSON 2020-05-12 22:19:49 +02:00
Ske
dee229b08c Ignore weird Nginx errors from Discord 2020-05-12 22:19:33 +02:00
Ske
b9a89a1037 Fix handling lack of DM permissions when react-querying 2020-05-12 21:31:59 +02:00
Ske
8ea02dae81 Add more error reporting for Discord errors 2020-05-12 21:26:37 +02:00
Ske
60018bf69d Don't send ping message if bot doesn't have permissions 2020-05-12 21:26:37 +02:00
Ske
65bac86ac1 Only update status if we've received a Ready 2020-05-12 21:26:37 +02:00
Ske
a3517f8663 Refactor order of shard initialization 2020-05-12 21:26:37 +02:00
Fennel
8467f4f681 Add workaround for DSP internal member cache error 2020-05-10 18:44:59 -04:00
Ske
9a761ed7e4 Add display name to long member list 2020-05-08 02:03:31 +02:00
Ske
fd65846867 Extract the explanation from the help message into a separate command 2020-05-08 02:01:57 +02:00
Ske
cb8234b272 Restructure message info embed queries
This fixes several long-standing issues wrt. handling of senders that are no longer on the server and deleted accounts, as well as an error handling issue caused by the DSharpPlus migration.
2020-05-08 00:57:17 +02:00
Ske
53582997f0 Ignore CloudFlare error response parsing errors 2020-05-07 23:59:05 +02:00
Ske
e9a271ef60 Skip leading spaces when command parsing 2020-05-07 23:43:17 +02:00
Ske
668d249872 Add support for more smart quote types 2020-05-07 23:43:07 +02:00
Ske
356fb76cb2 Drop consecutive duplicate messages from the gateway 2020-05-06 23:48:45 +02:00
Ske
cde495cd3a Add another delay to double-super-ensure the log buffers are flushed 2020-05-06 23:43:37 +02:00
Ske
892601110f Temporary workaround for https://github.com/DSharpPlus/DSharpPlus/issues/565 2020-05-05 19:10:33 +02:00
Ske
c1d17c2944 Fix member avatar in log channel message 2020-05-05 19:05:52 +02:00
Ske
ffa6faddd2 Clean up some log levels in CpuStatService 2020-05-05 18:12:45 +02:00
Ske
0b41b4f6b8 Add graceful shutdown on SIGKILL/SIGINT 2020-05-05 18:12:34 +02:00
Ske
a052c8331c Properly pass exceptions to Sentry 2020-05-05 16:42:14 +02:00
Ske
f803b9a392 Add a character limit to avatar URLs (256 for now) 2020-05-05 16:04:17 +02:00
Ske
2579683da9 Refactor interactive event handlers 2020-05-05 16:03:46 +02:00
Ske
e298f6f652 Add support for SafetyAtLast bot 2020-05-02 20:42:42 +02:00
Ske
ee9c87a29f Refactor permission utils to properly account for lack of channel access 2020-05-02 16:25:17 +02:00
Ske
f97ceac1fb Refactor Sentry scope enrichment 2020-05-02 16:00:43 +02:00
Ske
f927450352 Report bot permissions to Sentry 2020-05-02 15:45:45 +02:00
Ske
3fd89c1a45 Refactor TryParseMention function to use regexes 2020-05-02 15:43:07 +02:00
Ske
cad5b71f14 Fix system lookup errors where user ID doesn't exist 2020-05-02 15:33:05 +02:00
Ske
720755844f Rename BotHasPermission to a more descriptive name 2020-05-02 15:29:36 +02:00
Ske
ca57d10f7c Change formatting of shard number in status 2020-05-02 14:25:28 +02:00
Astrid
c551533313
Merge pull request #167 from acw0/master
Add current shard ID in status message
2020-05-02 14:22:03 +02:00
Ske
999ea5f0b5 Refactor and simplify the main bot classes 2020-05-02 01:52:52 +02:00
Ske
7488ca459b Hopefully fix shard info tracking (again) 2020-05-01 20:27:51 +02:00
acw0
08077f6426 Add current shard ID in status message 2020-05-01 14:17:30 -04:00
Ske
91b60367f0 Hopefully fix error in LogClean module 2020-05-01 19:41:15 +02:00
Ske
e7b28261b2 "Properly" handle CloudFlare errors in webhook execution 2020-05-01 19:21:02 +02:00
Ske
b927d0c2b7 Remove a few unnecessary extensions 2020-05-01 17:38:16 +02:00
Ske
48833639e2 Update shard status tracker for new library 2020-05-01 17:30:12 +02:00
Ske
d0f1aeb548 Fix member lookup in SanitizeEveryoneMaybe 2020-05-01 17:03:43 +02:00
Ske
e133bd657d Remove log channels if they don't exist 2020-05-01 16:36:21 +02:00
Ske
7e43b75f97 Fix errors on eg. incoming link embed update events 2020-05-01 15:41:37 +02:00
Ske
e4ebd2a5fe Merge branch 'refactor/dsharpplus'
It's heeeeeeeere~
2020-05-01 15:21:55 +02:00
Ske
546cb7f97a Remove webhook rate limit cache
The move to DSharpPlus makes it unnecessary, as D#+ can actually do webhook invocations on its own.
2020-05-01 00:00:33 +02:00
Ske
042327d4aa Add online user counting back (ish) 2020-04-30 23:55:12 +02:00
Ske
697a24c4fa Remove unused assignment 2020-04-29 02:35:46 +02:00
Ske
12aef1f61d Refactor periodic event loop 2020-04-29 01:14:49 +02:00
Ske
9fa36b78ff Fix the garish default D#+ colors 2020-04-29 00:25:01 +02:00
Ske
86b6a90b1c Add proper credit to MentionUtils 2020-04-29 00:06:40 +02:00
Ske
9b6f79a508 Factor DiscordConfiguration out into DI 2020-04-29 00:05:26 +02:00
Ske
35e30f481b Fix error in stats collection task 2020-04-29 00:04:53 +02:00
Ske
607a518cb8 Fix permchecking other guilds than the one you're in 2020-04-28 22:56:43 +02:00
Fennel
66dd850504 Fix SocketErrored and Ready events 2020-04-28 22:30:11 +02:00
Fennel
adb4262237 Remove Extraneous Using Alias 2020-04-28 22:30:11 +02:00
Fennel
25ce2539bc Remove Extraneous Comment 2020-04-28 22:30:11 +02:00
Fennel
2fd07c9ec9 Fix Periodic Methods 2020-04-28 22:30:11 +02:00
Fennel
c41f2c7c9b Fix Proxied Message Logging 2020-04-28 22:30:11 +02:00
Fennel
bdb6019cb9 Fix MatchChannel 2020-04-28 22:30:11 +02:00
Fennel
4e988867fe Refactor Unnecessary Enum Checks 2020-04-28 22:30:11 +02:00
Fennel
ebaded4bbd Fix Proxied Messages Ignored 2020-04-28 22:30:11 +02:00
Fennel
949dae6561 Add Extension Methods 2020-04-28 22:30:11 +02:00
Fennel
c99784b9dc Fix Build Errors 2020-04-28 22:30:11 +02:00
Ske
8cfb1b01ab Hide channels from pk;permcheck if user does not have view permissions 2020-04-28 22:06:48 +02:00
Ske
5386f24b69 Fix permissions check when proxying 2020-04-22 09:27:55 +02:00
Ske
23cf06df4c Port some things, still does not compile 2020-04-17 23:10:01 +02:00
Ske
f56c3e819f Replace Discord.Net with DSharpPlus
This commit will not compile.
2020-04-17 18:38:12 +02:00
Ske
02e2c9314b Update webhook rate limit code 2020-04-16 22:30:13 +02:00
Ske
05595329b5 Collect metrics about webhook rate limit cache size 2020-04-16 18:20:53 +02:00
Ske
93bf7c6543 Add periodic garbage collection of webhook rate limit cache 2020-04-16 18:18:08 +02:00
Ske
4701f4b56c Add proper logging of startup errors 2020-03-27 00:02:56 +01:00
Ske
fa70df8f98 Add proper webhook rate limit support 2020-03-27 00:01:42 +01:00
Ske
12d29eba44 Fix wrong message in privacy lookup 2020-03-09 11:00:28 +01:00
Ske
0eb2e8be6f Skip messages before current user ID is established 2020-03-08 11:10:05 +01:00
Ske
20789411f6 Cancel early when rate limited 2020-03-08 11:06:08 +01:00
Ske
f8d0fb2f4b Properly ignore invalid server-side data when executing webhooks 2020-03-08 10:55:47 +01:00
Ske
0f8786143f Ignore database shutting down errors 2020-03-08 10:55:33 +01:00
Ske
8b55e1364d Properly sanitize raw member description output 2020-03-08 10:34:47 +01:00
Ske
c6e813853a Remove "a" keyword for pk;find 2020-03-05 19:08:32 +01:00
Ske
ab8b5e3786 Fix setting proxies starting with text 2020-03-05 00:07:42 +01:00
Ske
35b0659d05 Don't ping by reaction if sender doesn't have permissions 2020-03-04 18:39:51 +01:00
Ske
e49f2850c6 Add support for Vanessa log cleaning 2020-03-04 18:32:14 +01:00
Ske
628ae6beb7 Update command list documentation 2020-03-04 18:28:13 +01:00
Ske
373423e6c5 Restructure the rest of the commands 2020-03-04 18:13:36 +01:00
Ske
1169669cf1 Restructure member description command 2020-02-28 00:23:54 +01:00
Ske
bcc9659117 Add "clear" subcommand in addition to flags 2020-02-27 18:07:05 +01:00
Ske
f03b4683f7 Restructure system proxy command 2020-02-27 18:06:13 +01:00
Ske
f291714cff Restructure system description command 2020-02-27 17:50:52 +01:00
Ske
823b101b63 Restructure system timezone command 2020-02-27 17:50:52 +01:00
Ske
4df3be8c3a Restructure system tag command 2020-02-27 17:50:52 +01:00
Ske
ee3ac44664 Properly handle 5xx errors from webhook calls 2020-02-26 19:47:30 +01:00
Ske
45c5e5ed42 Normalize colors to lowercase hex 2020-02-25 16:37:52 +01:00
Ske
a95d12639d Handle send message/embed links permission erorrs gracefully 2020-02-24 09:57:16 +01:00
Ske
f97c18aed0 Ignore flags when parsing system tags 2020-02-23 00:15:53 +01:00
Ske
eefbf0630e Fix fuzzy log clean match error with multiple messages 2020-02-22 20:08:20 +01:00
Ske
75947301f1 Properly skip flag parsing when handling proxy tags 2020-02-22 15:21:48 +01:00
Ske
8d3be79d33 Don't attempt to send log messages if the bot doesn't have permissions 2020-02-22 01:54:10 +01:00
Ske
493f7b12e5 Skip flag parsing when handling proxy tags 2020-02-20 23:53:05 +01:00
Ske
de141d629b Fix newline rendering in embeds on iOS 2020-02-20 22:57:37 +01:00
Ske
456fe8f7af Ignore weirdly formatted server errors too 2020-02-19 01:00:23 +01:00
Ske
2354e7fd74 Ignore timeout errors 2020-02-18 21:56:15 +01:00
Ske
55671b45d6 Add support for UnbelievaBoat 2020-02-15 14:17:25 +01:00
Ske
ccf81b0826 Add support for Pancake 2020-02-15 14:17:25 +01:00
Ske
e9cc8ed424 Add logger bot cleanup support 2020-02-15 14:17:25 +01:00
Ske
2268a33600 Correct word in member find title 2020-02-15 14:14:27 +01:00
Ske
e70236b9c0 Send member card on proxy query 2020-02-15 00:12:46 +01:00
Ske
268eabb047 Properly target system find 2020-02-13 20:25:00 +01:00
Ske
a76d7a6777 Add member find/search command 2020-02-13 16:49:45 +01:00
Ske
883796de16 Refactor system list command 2020-02-13 16:35:50 +01:00
Ske
48342a2890 Fix spurious empty-string-description errors 2020-02-12 23:18:31 +01:00
Ske
7a1aaf6dbd Add basic flag parsing support 2020-02-12 21:40:02 +01:00
Ske
dc10a8411a Disable autoproxy retriggering on edit 2020-02-12 17:44:24 +01:00
Ske
d0d3579b17 Add server-specific member avatars 2020-02-12 17:42:12 +01:00
Ske
6d5004bf54 Large refactor and project restructuring 2020-02-12 15:16:19 +01:00
Ske
b68e221fc6 Track current shard in Sentry reports 2020-02-12 14:37:11 +01:00
Ske
1d3acb2392 Fix error when trying to DM a user with DMs disabled 2020-02-12 14:22:15 +01:00
Ske
1386e6743b Proxy edited messages if the message is the last one in the channel, and the edit introduces proxy tags where there were none previously 2020-02-12 14:21:48 +01:00
Ske
9394b14a38 Fix link in system created message 2020-02-09 22:35:16 +01:00
Ske
466aea439e Add getting started steps back 2020-02-09 15:30:19 +01:00
Ske
9d0af7f22a Fix image proxying with empty messages 2020-02-09 15:27:52 +01:00
Ske
e6ba9ffb51 Add space to short list footer 2020-02-09 14:26:09 +01:00
BeeFox-sys
9e47f98a23
Improve Docs (#151)
* Added configurable command prefix

* Added getting started, renamed files

* Add nav order, add assests, add system example

* Added a lot

* Update Emojis

* Add guide links to bot

* Added Images
2020-02-09 14:17:26 +01:00
Ske
f618bc2403 Fix pk;msg with message link 2020-02-07 22:24:03 +01:00
Ske
4c1a03bb00 Special case "private" and "public" as setters rather than togglers 2020-02-07 22:20:40 +01:00
Ske
594bcc5b7b Replace error with warning on legacy proxy command 2020-02-05 23:44:03 +01:00
Ske
3ce1078dc6 Add different text for systems with no members 2020-02-05 23:43:30 +01:00
Ske
565d166c68 Add more aliases to proxy add/remove 2020-02-04 18:16:45 +01:00
Ske
f27e864731 Fix autoproxying someone else's bare tags 2020-02-03 16:10:43 +01:00
Ske
5334975ab7 PROPERLY handle example proxy "text" 2020-02-03 15:11:35 +01:00
Ske
a7e071eb24 Fix permission check for reactions 2020-02-03 13:41:16 +01:00
Ske
f172123190 Fix setting proxy tags starting with "text" 2020-02-01 23:08:33 +01:00
Ske
6863da9462 Disable Discord member caching entirely 2020-02-01 15:00:36 +01:00
Ske
82dfe43d5a Rework caching
This does a *lot* of things. Essentially, it replaces the existing
individual proxy- and autoproxy caches on the bot end with a
global cache (in Core) that handles all the caching at once, and
automatically invalidates the cache once something changes in the
datastore.

This allows us to do proxying and autoproxying with *zero database
queries* (best-case).
2020-02-01 14:40:57 +01:00
Ske
125ea81ec3 Move command functions around 2020-02-01 13:03:44 +01:00
Ske
a5f0d7ac13 Handle proxy tag length overflow in short member list 2020-01-31 11:43:53 +01:00
Ske
5caf040bbc Properly handle setting empty proxy tags 2020-01-30 10:20:47 +01:00
Ske
3b2167e16f Shuffle dependencies around 2020-01-26 01:30:39 +01:00
Ske
1ea0526ef8 Migrate DI container to Autofac 2020-01-26 01:27:45 +01:00
Ske
4311cb3ad1 Fix unlinking deleted accounts 2020-01-25 18:08:35 +01:00
Ske
3ba6a115f0 Correct autoproxy escape character 2020-01-25 17:40:41 +01:00
Astrid
eb44c8fda2
Merge pull request #150 from xSke/feature/autoproxy
Implement autoproxy. Closes #149.
2020-01-25 16:35:31 +01:00
Ske
0abd64b354 Fix punctuation error 2020-01-25 00:58:25 +01:00
Ske
83cfb3eb46 Add autoproxy functionality 2020-01-24 20:28:48 +01:00
Ske
b4439ba872 Add another alias to member privacy 2020-01-23 21:21:52 +01:00
Ske
57bc576de6 Add autoproxy management commands 2020-01-23 21:20:22 +01:00
Ske
b347d2d557 Add front history pagination; upgrade more store methods 2020-01-18 00:58:35 +01:00
Ske
8a689ac0f2 Upgrade various store methods to IAsyncEnumerable 2020-01-18 00:02:17 +01:00
Ske
335f6203cc Restrict pk;random to public members 2020-01-14 12:41:28 +01:00
Ske
f10685acd4 Fix system privacy command usage 2020-01-14 12:22:33 +01:00
Ske
98613c4287 Add system and member privacy support 2020-01-11 16:51:13 +01:00
BerryCode
f0cc5c5961 Add pk;random command (#146) 2020-01-08 21:33:14 +01:00
Grey Himmel
da83f72582 Update Bot.cs
- Add note telling users to describe what happened when reporting errors
2020-01-08 20:40:32 +01:00
Ske
cb1c44a27f Bail early if we don't have send message permission when proxying 2020-01-08 12:16:27 +01:00
Ske
8b65754b00 Fix error when removing reactions on a deleted message 2020-01-03 14:02:25 +01:00
Ske
c89802a21c Fix matching commands with a newline instead of a space after command name 2020-01-03 13:30:50 +01:00
Ske
54aa9fb7d7 Change handling of Tupperbox per-member tags 2019-12-28 15:53:11 +01:00
Ske
c80965394d Add system avatar preview as well 2019-12-28 12:47:31 +01:00
Ske
468241c92f Add avatar preview with no arguments 2019-12-28 12:23:52 +01:00
Ske
30c0fc9b43 Update syntax error formatting 2019-12-28 12:16:26 +01:00
Ske
9ad16a98ed Throw syntax error when no argument is given to member rename 2019-12-28 12:16:08 +01:00
Ske
f610f88351 Add more aliases for enabling/disabling proxying 2019-12-28 12:12:22 +01:00
Ske
73b2631280 Optimize database queries for proxy filtering 2019-12-28 12:00:52 +01:00
Ske
18dc1664db Add another alias for servername 2019-12-27 11:43:06 +01:00
Ske
4a30e56298 Add basic database schema migration system 2019-12-26 21:43:05 +01:00
Ske
4d07886ec8 Add server-specific display names 2019-12-26 20:39:47 +01:00
Ske
cd09c9758c Fix fast reactions to yes/no prompts not registering 2019-12-26 20:27:22 +01:00
Ske
633627c30a Fix image-only proxies where the tags have trailing/leading spaces 2019-12-26 19:19:06 +01:00
Ske
441867f1cb Use culture-invariant comparisons when sorting member list 2019-12-24 01:09:48 +01:00
Ske
1c184825e3 Use fork of D.NET to potentially resolve issues 2019-12-23 18:36:56 +01:00
Ske
6a4c131d6d Upgrade every dependency to latest compatible version 2019-12-23 15:53:20 +01:00
Ske
9dd945ddd9 Let's actually not log everything. 2019-12-23 15:49:51 +01:00
Ske
5448f734d4 Try logging *literally everything* 2019-12-23 14:44:20 +01:00
Ske
5ff32ea6b4 Re-enable proxy attachments 2019-12-23 13:55:43 +01:00
Ske
58cdb04ab9 Practice better disposal hygiene 2019-12-23 01:58:10 +01:00
Ske
3fdfaeab01 Disable message attachments as a temporary fix 2019-12-23 01:53:01 +01:00
Ske
265184f4f6 Couple tweaks to potentially improve performance 2019-12-23 01:49:21 +01:00
Ske
bbbbb5a046 Fix error on empty message 2019-12-23 01:49:00 +01:00
Ske
affb42160a Oops pt. 3 2019-12-23 00:35:42 +01:00
Ske
de75752b5e Oops pt. 2 2019-12-23 00:35:25 +01:00
Ske
4a8dd7e8e3 Oops 2019-12-23 00:31:31 +01:00
Ske
05282fd167 Reuse a singleton HttpClient for proxying 2019-12-23 00:29:04 +01:00
Ske
c70556f5f9 Increase minimum thread pool size 2019-12-23 00:28:19 +01:00
Ske
b6597c79d6 Add temporary ThreadPool trace logging 2019-12-22 23:27:11 +01:00
Ske
3c95f35553 Reduce timeouts on webhook invocations 2019-12-22 22:56:18 +01:00
Ske
cb836d5f7e Remove the ping reaction afterwards 2019-12-22 14:44:14 +01:00
Ske
7bccaab20d Fix stat number displays 2019-12-22 14:37:55 +01:00
Ske
3b5ca3d62e Properly reset stat message content 2019-12-22 14:35:18 +01:00
Ske
d2205ea7e6 Update documentation with new features 2019-12-22 14:26:53 +01:00
Ske
639c813ce7 Add per-server per-system proxy enable toggle 2019-12-22 14:15:56 +01:00
Ske
857b0488b9 Add member pinging by reaction 2019-12-22 13:54:18 +01:00
Ske
bd8fb40bc7 Handle systems with (too) many linked accounts 2019-12-22 13:53:38 +01:00
Ske
992a37dd1b Lower logging level of proxy cache messages 2019-12-22 12:50:56 +01:00
Ske
b81eda47aa Expand pk;stats functionality 2019-12-22 12:50:47 +01:00
Ske
93a52ff95a Add exception logging for dropped connections 2019-12-22 12:08:52 +01:00
Ske
6a55555e48 Attempt a few memory/connection optimizations 2019-12-22 01:08:14 +01:00
Ske
9c9e48a799 Upgrade to .NET Core 3.1 2019-12-22 00:40:57 +01:00
Ske
7b55abaacd Properly register command statistics 2019-12-21 21:51:41 +01:00
Ske
3b72fa720b Add warning when setting proxy tags conflicting with another member's 2019-12-21 21:42:06 +01:00
Ske
d42dea9e9f Allow multiple proxy attachments 2019-12-21 20:07:51 +01:00
Ske
474d561c54 Execute webhooks directly rather than through D.NET 2019-12-21 18:50:28 +01:00
Ske
378cba09e5 Add channel blacklists for logging and proxying
Necessary database migrations for this commit:
    alter table servers add column log_blacklist bigint[] not null default array[]::bigint[];
    alter table servers add column blacklist bigint[] not null default array[]::bigint[];
2019-11-03 19:15:50 +01:00
Ske
0cdd99d195 Error when given an invalid image file 2019-11-03 13:56:05 +01:00
Ske
8d003da091 Remove chunk of commented-out outdated code 2019-11-03 13:37:48 +01:00
Ske
03dd91ee9e Update tag change message with more information 2019-11-03 13:37:36 +01:00
Ske
520e6f140c Fix front history lookup with very long switches 2019-11-03 00:46:38 +01:00
Ske
0226e73d88 Improve in-bot command documentation
Adds command descriptions, changes formatting on
command listings, and adds more direct command
listing commands.
2019-11-03 00:29:11 +01:00
Ske
7c3b4b9af9 Add command to delete all switches 2019-11-02 22:46:51 +01:00
Ske
6aa72f68b3 Add syntax error if pk;m proxy is missing arguments 2019-11-02 02:57:55 +01:00
Ske
6c39b7549b Fix message querying actually for real 2019-10-31 21:14:01 +01:00
Ske
0f48c6879b Attempt to fix slow/timeout-y bot startup
I've noticed the bot's CPU spiking for a few minutes as it's
just connecting, and a lot of shard connections are timing out.

I suspect it might be the overload of messages as the shards
connect and Discord sends it the entire backlog at once. So,
as an interim solution, I'm making it simply discard every
message before the socket is fully connected. Hopefully this
should help reduce the pressure.
2019-10-31 17:21:12 +01:00
Ske
f4a5b409c3 Fix message querying for real this time 2019-10-31 16:36:33 +01:00
Ske
1a79d52bfb Add importing of Tupperbox multibrackets 2019-10-30 14:11:24 +01:00
Ske
49dc25ee02 Allow keeping proxy tags when proxying messages.
Required database migration:

Closes #75.
2019-10-30 09:26:50 +01:00
Ske
acadad2a43 Add forgotten conditional to proxy tag clear disclaimer 2019-10-30 08:44:17 +01:00
Ske
b50c123ad4 Properly sort proxies before matching 2019-10-30 08:30:58 +01:00
Ske
393ee16c1b Add support for multiple proxy tags
Tangentially closes #103.
2019-10-30 08:18:59 +01:00
Ske
8f60377d63 Add support for iOS-style quotation marks 2019-10-28 20:17:20 +01:00
Ske
3c7afbfdaa Lower log level of an unnecessary webhook logging message 2019-10-28 17:03:16 +01:00
Ske
c639e9ba1e Include attachment image in message card 2019-10-28 17:02:59 +01:00
Ske
3369a06c4e Fix message querying on accounts with no roles 2019-10-28 16:50:41 +01:00
Ske
bfafdbe2bf Invalidate proxy cache when clearing proxy tags 2019-10-28 00:38:06 +01:00
Noko
eb5fe7d6a4 Allow frontpercent to accept time patterns in system timezone (#135)
The frontpercent command already accepted time patterns (e.g. 9pm), but these were always being interpreted as UTC regardless of the system's configured zone. Furthermore, the time wasn't being nudged to the previous day, so if you tried to do pk;s fp 6pm at 5pm UTC, it would complain about the date being in the future instead of just showing you since 6pm yesterday.

The system zone is now respected and nudging enabled in the same manner as pk;sw move.
2019-10-28 00:21:55 +01:00
Ske
545e8df6a7 Reduce the log level of various common events 2019-10-27 23:44:27 +01:00
Ske
823688e63d Add pk;flash command 2019-10-27 23:03:20 +01:00
Ske
fbb5dbbf5d Don't embed support server link in error message 2019-10-27 23:01:38 +01:00
Ske
46672d264c Refactor log channel storage 2019-10-27 23:01:20 +01:00
Ske
4e98a51363 Fix PermCheck permissions and no-guild invocation syntax 2019-10-27 21:58:04 +01:00
Ske
523469e5e6 Remove preemptive warning messages for unproxyable members
The member length limit is now long enough that it's unlikely to
hit the cap by accident. An error will still be displayed if you
attempt to perform a message proxy.
2019-10-27 21:57:31 +01:00
Ske
c8b4d186d8 Prioritize member lookup by name over ID 2019-10-27 20:48:48 +01:00
Ske
b19b2fbb38 Fix matching multiple consecutive quoted strings 2019-10-27 17:09:15 +01:00
Ske
7f55fca625 Make prefix matching case-insensitive 2019-10-27 15:08:33 +01:00
Ske
6538c5d054 Fix line endings in WebhookCacheService 2019-10-27 13:09:07 +01:00
Ske
aed38f37f7 Allow starting bot before all shards are up 2019-10-27 13:01:33 +01:00
Ske
6a73b3bdd6 Refactor data stores, merging the Store classes 2019-10-26 19:45:44 +02:00
Astrid
029eed3786
Merge pull request #134 from nephanim/feature/member-limit
Add members per system cap & improve import performance
2019-10-22 19:33:30 +02:00
Ske
53ae0e3d70 Improve error handling and reporting after command rewrite 2019-10-22 19:31:40 +02:00
Noko
3d21adeec9 Fix reversal of import response messages
Some of the command rewrite changes resulted in the response messages for importing a system being swapped. When importing without an existing system (ctx.System == null), we want to display the "new system" message. Otherwise, show the count added/modified.
2019-10-20 02:22:22 -05:00
Noko
397da2e1fa Added max member count to limits
A given system can now have up to 1000 members. Within 50 members of that limit, a warning will display whenever a new member is created via the bot. Once the limit is reached, a final warning will appear indicating that no additional members can be created unless members are first deleted. Attempting to create a new member at that point by any method will result in an error message indicating that the limit has been reached.

Respecting this in pk;import required some restructuring to tease apart which members already exist and which ones need to be created prior to creating any members as it seems preferable to fail early and give the user the ability to intervene rather than pushing the system to the member cap and requiring manual deletion of "lower priority" members before others can be created. One consequence of the restructure is that existing members are being read in bulk which is a performance improvement of 25-70% depending on how many switches need to be imported (the more members you have, the more noticeable this is).
2019-10-20 02:16:57 -05:00
Astrid
af4da8fd72
Merge branch 'master' into patch-2 2019-10-18 13:37:09 +02:00
Ske
c4d28f64c7 Display system/member created date in embed footer.
Closes #122.
2019-10-18 13:29:16 +02:00
Astrid
1d7a4d78db
Merge pull request #126 from xBelladonna/feature/messagecard-nickname
Display guild user nickname on message card if set
2019-10-18 13:22:48 +02:00
Ske
83c709b69d Sanitize more inputs 2019-10-18 13:14:36 +02:00
Ske
1988b29fbc Refactor command system 2019-10-05 07:41:00 +02:00
xBelladonna
658bcf1faf Display guild user nickname on message card if set 2019-09-22 02:04:20 +09:30
Ske
0ec522ca0a Display member roles in message query card 2019-09-21 15:19:38 +02:00
Ske
86d0b24758 Include event ID in Sentry dump 2019-09-02 20:37:24 +02:00
Grey Himmel
ad6624ce02
Order members regardless of name case
Add `toLower()` method to the sorting used in system lists, so members are ordered regardless of if the first letter of their name is upper or lowercase
2019-08-25 20:25:37 -04:00
Ske
9b0b8b4353 Fix Clyde, also without an attachment 2019-08-14 07:21:03 +02:00
Ske
74e0508065 Increase webhook name limit to 80 2019-08-14 07:16:48 +02:00
Ske
4e69531103 Ignore invalid colors in member card 2019-08-13 21:49:43 +02:00
Ske
4d2c843442 Handle busy indicator without permission properly 2019-08-12 18:07:29 +02:00