mirror of
https://github.com/veganhacktivists/arabot.git
synced 2025-12-21 03:58:05 +01:00
feat(arabot): add fetching restricts from database
This commit is contained in:
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user