feat(arabot): add fetching restricts from database

This commit is contained in:
smyalygames
2023-02-20 01:09:38 +00:00
parent c60d8807a2
commit cd00be8147

View File

@@ -58,6 +58,19 @@ export async function unRestrict(userId: Snowflake, modId: Snowflake) {
});
}
export async function getRestrictions(userId: Snowflake) {
const restrictions = await container.database.restrict.findMany({
where: {
userId,
},
orderBy: {
id: 'asc',
},
});
return restrictions;
}
export async function checkActive(userId: Snowflake) {
const restriction = await container.database.restrict.findFirst({
where: {