/
kewerborliert
/
Computer-15
Обзор
Документация
Войти
/
kewerborliert
/
Computer-15
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
TelegramBot/Bot/Commands/cmd_cmd.lua
24 строки
864 B
afyyar
upload
29 дек 2024, 08:26
29 дек 2024, 08:26
099515e
Код
Авторство
О чём код?
local Cs = require "Bot.Service.CmdService" local Us = require "Bot.Service.UsersService" local Tg = require "Bot.Service.TelegramService" require "const" return function(chat_id, msg_text, add_task) if Us.CheckAdmin(chat_id) then add_task(function () local exec_status = Cs.ExecuteCmd(chat_id, msg_text, function (error) Tg.SendMessagePost(chat_id, error) end) if exec_status == true then Tg.SendMessage(chat_id, "Everything is going as planned, Master") elseif exec_status == CMD_NOT_FOUND then Tg.SendMessage(chat_id, "Command not found, try register command by /register") else Tg.SendMessage(chat_id, "transaction revert") end end) else Tg.SendMessage(chat_id, MSG_NOT_ADMIN) end end