mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-09 15:27:54 +00:00
Allow any linked account to edit/delete messages sent by the same system
Closes #375.
This commit is contained in:
parent
52a7a015cd
commit
a8727f474b
3 changed files with 29 additions and 22 deletions
|
|
@ -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
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue