2021-08-27 15:03:47 +00:00
|
|
|
using System.Collections.Generic;
|
2020-06-12 21:13:21 +00:00
|
|
|
using System.Data;
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
using Dapper;
|
|
|
|
|
|
|
|
namespace PluralKit.Core
|
|
|
|
{
|
2020-08-29 11:46:27 +00:00
|
|
|
public partial class ModelRepository
|
2020-06-12 21:13:21 +00:00
|
|
|
{
|
2020-08-29 11:46:27 +00:00
|
|
|
public Task<MessageContext> GetMessageContext(IPKConnection conn, ulong account, ulong guild, ulong channel)
|
2020-06-12 21:13:21 +00:00
|
|
|
{
|
2021-08-27 15:03:47 +00:00
|
|
|
return conn.QueryFirstAsync<MessageContext>("message_context",
|
|
|
|
new { account_id = account, guild_id = guild, channel_id = channel },
|
2020-06-12 21:13:21 +00:00
|
|
|
commandType: CommandType.StoredProcedure);
|
2021-08-27 15:03:47 +00:00
|
|
|
}
|
|
|
|
|
2020-08-29 11:46:27 +00:00
|
|
|
public Task<IEnumerable<ProxyMember>> GetProxyMembers(IPKConnection conn, ulong account, ulong guild)
|
2020-06-12 21:13:21 +00:00
|
|
|
{
|
2021-08-27 15:03:47 +00:00
|
|
|
return conn.QueryAsync<ProxyMember>("proxy_members",
|
|
|
|
new { account_id = account, guild_id = guild },
|
2020-06-12 21:13:21 +00:00
|
|
|
commandType: CommandType.StoredProcedure);
|
2021-08-27 15:03:47 +00:00
|
|
|
}
|
2020-06-12 21:13:21 +00:00
|
|
|
}
|
|
|
|
}
|