mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
Add message editing command
Signed-off-by: Ske <voltasalt@gmail.com>
This commit is contained in:
parent
33cabff359
commit
3d624b39e4
9 changed files with 173 additions and 11 deletions
|
|
@ -42,6 +42,18 @@ namespace PluralKit.Core
|
|||
_logger.Information("Bulk deleted messages ({FoundCount} found) from database: {MessageIds}", rowCount,
|
||||
ids);
|
||||
}
|
||||
|
||||
public async Task<PKMessage?> GetLastMessage(IPKConnection conn, ulong guildId, ulong channelId, ulong accountId)
|
||||
{
|
||||
// Want to index scan on the (guild, sender, mid) index so need the additional constraint
|
||||
return await conn.QuerySingleOrDefaultAsync<PKMessage>(
|
||||
"select * from messages where guild = @Guild and channel = @Channel and sender = @Sender order by mid desc limit 1", new
|
||||
{
|
||||
Guild = guildId,
|
||||
Channel = channelId,
|
||||
Sender = accountId
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public class PKMessage
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue