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
This commit is contained in:
@@ -281,7 +281,7 @@ namespace PluralKit.Core {
|
||||
/// Deletes messages from the data store in bulk.
|
||||
/// </summary>
|
||||
/// <param name="postedMessageIds">The IDs of the webhook messages to delete.</param>
|
||||
Task DeleteMessagesBulk(IEnumerable<ulong> postedMessageIds);
|
||||
Task DeleteMessagesBulk(IReadOnlyCollection<ulong> postedMessageIds);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the most recent message sent by a given account in a given guild.
|
||||
|
@@ -296,7 +296,7 @@ namespace PluralKit.Core {
|
||||
_logger.Information("Deleted message {Message}", id);
|
||||
}
|
||||
|
||||
public async Task DeleteMessagesBulk(IEnumerable<ulong> ids)
|
||||
public async Task DeleteMessagesBulk(IReadOnlyCollection<ulong> ids)
|
||||
{
|
||||
using (var conn = await _conn.Obtain())
|
||||
{
|
||||
|
@@ -187,6 +187,7 @@ namespace PluralKit.Core
|
||||
public ulong[] Accounts;
|
||||
|
||||
public SystemGuildSettings SettingsForGuild(ulong guild) =>
|
||||
// O(n) lookup since n is small (max ~100 in prod) and we're more constrained by memory (for a dictionary) here
|
||||
SystemGuild.FirstOrDefault(s => s.Guild == guild) ?? new SystemGuildSettings();
|
||||
|
||||
public MemberGuildSettings SettingsForMemberGuild(int memberId, ulong guild) =>
|
||||
|
Reference in New Issue
Block a user