39 lines
1.2 KiB
TypeScript
39 lines
1.2 KiB
TypeScript
// Type used in used in every table that reffers to a specific user
|
|
export interface UserID { id: string }
|
|
|
|
export interface User extends UserID {
|
|
// If some user added from the telegram -- tg_id shouldn't be null
|
|
// But in case of adding later other ways to interract with the MIC
|
|
// We gonna make it nullable
|
|
tg_id: number | null
|
|
joined_by_referal_from_user_id: string | null
|
|
is_chat_participant: boolean
|
|
is_captcha_passed: boolean
|
|
is_timeout: boolean
|
|
is_banned: boolean
|
|
created_at: Date
|
|
joined_chat_at: Date | null
|
|
timeout_until: Date | null
|
|
}
|
|
|
|
export interface InviteLink {
|
|
link: string
|
|
expect_user_tg_id: number
|
|
}
|
|
|
|
export interface UserRestrictionsInfo extends UserID {
|
|
tg_id: number | null
|
|
is_banned: boolean
|
|
is_timeout: boolean
|
|
timeout_until: Date | null
|
|
}
|
|
|
|
export interface UserCheckedRestrictions {
|
|
// If user is blocked everything else
|
|
// here suppose to be false by default
|
|
// So some checks are just skipped
|
|
// So if user is blocked+timed out,
|
|
// the isTimeout value still gonna be false
|
|
isBlocked: boolean
|
|
isTimeout: boolean
|
|
} |