2020-06-12 21:13:21 +00:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Data;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
using Dapper;
|
|
|
|
|
|
|
|
|
|
namespace PluralKit.Core
|
|
|
|
|
{
|
|
|
|
|
public static class DatabaseFunctionsExt
|
|
|
|
|
{
|
2020-06-13 16:31:20 +00:00
|
|
|
|
public static Task<MessageContext> QueryMessageContext(this IPKConnection conn, ulong account, ulong guild, ulong channel)
|
2020-06-12 21:13:21 +00:00
|
|
|
|
{
|
|
|
|
|
return conn.QueryFirstAsync<MessageContext>("message_context",
|
|
|
|
|
new { account_id = account, guild_id = guild, channel_id = channel },
|
|
|
|
|
commandType: CommandType.StoredProcedure);
|
|
|
|
|
}
|
|
|
|
|
|
2020-06-13 16:31:20 +00:00
|
|
|
|
public static Task<IEnumerable<ProxyMember>> QueryProxyMembers(this IPKConnection conn, ulong account, ulong guild)
|
2020-06-12 21:13:21 +00:00
|
|
|
|
{
|
|
|
|
|
return conn.QueryAsync<ProxyMember>("proxy_members",
|
|
|
|
|
new { account_id = account, guild_id = guild },
|
|
|
|
|
commandType: CommandType.StoredProcedure);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|