mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 13:06:50 +00:00
Move system tag/icon from ProxyMember to MessageContent
This commit is contained in:
parent
2a39489c4d
commit
729930a562
4 changed files with 17 additions and 18 deletions
|
|
@ -49,7 +49,7 @@ namespace PluralKit.Bot
|
|||
|
||||
// Permission check after proxy match so we don't get spammed when not actually proxying
|
||||
if (!await CheckBotPermissionsOrError(message.Channel)) return false;
|
||||
if (!CheckProxyNameBoundsOrError(match)) return false;
|
||||
if (!CheckProxyNameBoundsOrError(match.Member.ProxyName(ctx))) return false;
|
||||
|
||||
// Everything's in order, we can execute the proxy!
|
||||
await ExecuteProxy(message, ctx, match);
|
||||
|
|
@ -81,8 +81,8 @@ namespace PluralKit.Bot
|
|||
private async Task ExecuteProxy(DiscordMessage trigger, MessageContext ctx, ProxyMatch match)
|
||||
{
|
||||
// Send the webhook
|
||||
var id = await _webhookExecutor.ExecuteWebhook(trigger.Channel, match.Member.ProxyName,
|
||||
match.Member.ProxyAvatar,
|
||||
var id = await _webhookExecutor.ExecuteWebhook(trigger.Channel, match.Member.ProxyName(ctx),
|
||||
match.Member.ProxyAvatar(ctx),
|
||||
match.Content, trigger.Attachments);
|
||||
|
||||
// Handle post-proxy actions
|
||||
|
|
@ -129,9 +129,8 @@ namespace PluralKit.Bot
|
|||
return true;
|
||||
}
|
||||
|
||||
private bool CheckProxyNameBoundsOrError(ProxyMatch match)
|
||||
private bool CheckProxyNameBoundsOrError(string proxyName)
|
||||
{
|
||||
var proxyName = match.Member.ProxyName;
|
||||
if (proxyName.Length < 2) throw Errors.ProxyNameTooShort(proxyName);
|
||||
if (proxyName.Length > Limits.MaxProxyNameLength) throw Errors.ProxyNameTooLong(proxyName);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue