Add handling command ❌ reactions
and, uhh, rename invoker_id to author_id
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
create table command_message
|
||||
(
|
||||
message_id bigint primary key,
|
||||
invoker_id bigint not null,
|
||||
author_id bigint not null,
|
||||
timestamp timestamp not null default now()
|
||||
);
|
||||
|
||||
|
@@ -9,7 +9,16 @@ namespace PluralKit.Core
|
||||
public partial class ModelRepository
|
||||
{
|
||||
public Task SaveCommandMessage(IPKConnection conn, ulong message_id, ulong author_id) =>
|
||||
conn.QueryAsync("insert into command_message (message_id, invoker_id) values (@Message, @Author)",
|
||||
conn.QueryAsync("insert into command_message (message_id, author_id) values (@Message, @Author)",
|
||||
new {Message = message_id, Author = author_id });
|
||||
|
||||
public Task<CommandMessage> GetCommandMessage(IPKConnection conn, ulong message_id) =>
|
||||
conn.QuerySingleOrDefaultAsync<CommandMessage>("select message_id, author_id from command_message where message_id = @Message",
|
||||
new {Message = message_id});
|
||||
}
|
||||
|
||||
public class CommandMessage
|
||||
{
|
||||
public ulong author_id { get; set; }
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user