/
kewerborliert
/
Computer-15
Обзор
Документация
Войти
/
kewerborliert
/
Computer-15
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
TelegramBot/Bot/Service/UsersService.lua
20 строк
459 B
afyyar
upload
29 дек 2024, 08:26
29 дек 2024, 08:26
099515e
Код
Авторство
О чём код?
local Ur = require "Bot.Repositories.UserRepository" local Sr = require "Bot.Repositories.SettingsRepository" local function auth_user(admin_password, chat_id) local admin = admin_password == Sr.GetAdminPassword() local user = Ur.GetUserByChatId(chat_id) if (user) then Ur.ChangeAdminRights(chat_id, admin) else Ur.CreateUser(chat_id, admin) end end return { CheckAdmin = Ur.CheckAdmin, AuthUser = auth_user }