Allow any linked account to edit/delete messages sent by the same system

Closes #375.
This commit is contained in:
spiral
2021-07-27 11:39:37 -04:00
parent 52a7a015cd
commit a8727f474b
3 changed files with 29 additions and 22 deletions

View File

@@ -115,8 +115,11 @@ namespace PluralKit.Bot
if (!_bot.PermissionsIn(evt.ChannelId).HasFlag(PermissionSet.ManageMessages))
return;
using var conn = await _db.Obtain();
var system = await _repo.GetSystemByAccount(conn, evt.UserId);
// Can only delete your own message
if (msg.Message.Sender != evt.UserId) return;
if (msg.System.Id != system.Id) return;
try
{