mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-07 06:17:55 +00:00
Split message/proxy data up in MessageContext and ProxyMember
This commit is contained in:
parent
ba441a15cc
commit
3d62a0d33c
18 changed files with 296 additions and 499 deletions
25
PluralKit.Core/Database/Functions/DatabaseFunctionsExt.cs
Normal file
25
PluralKit.Core/Database/Functions/DatabaseFunctionsExt.cs
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using Dapper;
|
||||
|
||||
namespace PluralKit.Core
|
||||
{
|
||||
public static class DatabaseFunctionsExt
|
||||
{
|
||||
public static Task<MessageContext> QueryMessageContext(this IDbConnection conn, ulong account, ulong guild, ulong channel)
|
||||
{
|
||||
return conn.QueryFirstAsync<MessageContext>("message_context",
|
||||
new { account_id = account, guild_id = guild, channel_id = channel },
|
||||
commandType: CommandType.StoredProcedure);
|
||||
}
|
||||
|
||||
public static Task<IEnumerable<ProxyMember>> QueryProxyMembers(this IDbConnection conn, ulong account, ulong guild)
|
||||
{
|
||||
return conn.QueryAsync<ProxyMember>("proxy_members",
|
||||
new { account_id = account, guild_id = guild },
|
||||
commandType: CommandType.StoredProcedure);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue