/
kewerborliert
/
Computer-15
Обзор
Документация
Войти
/
kewerborliert
/
Computer-15
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
TelegramBot/Bot/Commands/cmd_lua.lua
27 строк
884 B
afyyar
upload
29 дек 2024, 08:26
29 дек 2024, 08:26
099515e
Код
Авторство
О чём код?
local Tg = require "Bot.Service.TelegramService" local Cs = require "Bot.Service.CmdService" local Us = require "Bot.Service.UsersService" require "const" return function(actions, chat_id, add_task) if Us.CheckAdmin(chat_id) then Tg.SendMessage(chat_id, "Send me lua code to execute by Computer-"..os.computerID()) actions[chat_id] = function(msg_text) add_task(function() if Cs.ExecuteLua(msg_text, chat_id, function (error) Tg.SendMessagePost(chat_id, error) end) then Tg.SendMessage(chat_id, "Everything is going as planned, Master") else Tg.SendMessage(chat_id, "transaction revert") end end) actions[chat_id] = nil end else Tg.SendMessage(chat_id, MSG_NOT_ADMIN) end end