This commit is contained in:
Er2 2022-01-18 19:34:23 +00:00
parent 9a9bd56b7d
commit 5dee01b07b
2 changed files with 19 additions and 0 deletions

View File

@ -3,6 +3,7 @@ return {
owner = 935626920 , -- hehe
cmds = {
'eval',
'reload',
'ping',
'rub',
'start',
@ -10,6 +11,7 @@ return {
events = {
'command',
'ready',
'inlineQuery',
},
parts = {
'locale',

17
src/cmds/reload.lua Normal file
View File

@ -0,0 +1,17 @@
return {
private = true,
run = function(C, msg)
local cat, sub = table.unpack(msg.args)
if not (cat and sub) then
return C.api:reply(msg, '/reload cmds ping')
end
local path = 'src.'..cat..'.'..sub
package.loaded[path] = nil
local err, m = pcall(require, path)
C.api:reply(msg, ('Reloaded. %s (%s)'):format(
err and 'Error:' or 'No errors',
m
))
end
}