mic-bot/core/entities.ts

39 lines
1.2 KiB
TypeScript
Raw Normal View History

2024-10-19 10:00:35 +00:00
// 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
2024-10-23 16:09:10 +00:00
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
2024-10-19 10:00:35 +00:00
}
export interface InviteLink {
link: string
expect_user_tg_id: number
}
2024-10-23 16:09:10 +00:00
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
}