mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
feat: delete command messages with pk;msg -delete
This commit is contained in:
parent
fa66fbe247
commit
0517c76abf
6 changed files with 48 additions and 11 deletions
|
|
@ -6,9 +6,9 @@ namespace PluralKit.Core
|
|||
{
|
||||
public partial class ModelRepository
|
||||
{
|
||||
public Task SaveCommandMessage(IPKConnection conn, ulong messageId, ulong authorId) =>
|
||||
conn.QueryAsync("insert into command_messages (message_id, author_id) values (@Message, @Author)",
|
||||
new { Message = messageId, Author = authorId });
|
||||
public Task SaveCommandMessage(IPKConnection conn, ulong messageId, ulong channelId, ulong authorId) =>
|
||||
conn.QueryAsync("insert into command_messages (message_id, channel_id, author_id) values (@Message, @Channel, @Author)",
|
||||
new { Message = messageId, Channel = channelId, Author = authorId });
|
||||
|
||||
public Task<CommandMessage?> GetCommandMessage(IPKConnection conn, ulong messageId) =>
|
||||
conn.QuerySingleOrDefaultAsync<CommandMessage>("select * from command_messages where message_id = @Message",
|
||||
|
|
@ -23,5 +23,6 @@ namespace PluralKit.Core
|
|||
{
|
||||
public ulong AuthorId { get; set; }
|
||||
public ulong MessageId { get; set; }
|
||||
public ulong ChannelId { get; set; }
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue