Compare commits

...

2 Commits

Author SHA1 Message Date
Yessiest 2db65f5788 oopsie in the help db 2022-05-28 17:10:19 +04:00
Yessiest 43ec66153b i forogr 2022-05-28 11:52:52 +04:00
2 changed files with 8 additions and 7 deletions

View File

@ -25,7 +25,7 @@ exec = function(v,command,tried)
log("ERROR","Unable to retrieve event channel: "..tostring(v.channel)) log("ERROR","Unable to retrieve event channel: "..tostring(v.channel))
log("ERROR","Failed event: "..command.."\nChannel Object: "..tostring(channel)) log("ERROR","Failed event: "..command.."\nChannel Object: "..tostring(channel))
if not tried then if not tried then
log("INFO","Retrying...") log("CRON","Retrying...")
timer.setTimeout(2000,function() timer.setTimeout(2000,function()
sync_emitter:emit("execContext",function() sync_emitter:emit("execContext",function()
exec(v,command,true) exec(v,command,true)
@ -42,7 +42,7 @@ exec = function(v,command,tried)
log("ERROR","Unable to retrieve event message: "..tostring(v.id)) log("ERROR","Unable to retrieve event message: "..tostring(v.id))
log("ERROR","Failed event: "..command.."\nMessage object: "..tostring(msg).."\nChannel: "..tostring(channel.id)) log("ERROR","Failed event: "..command.."\nMessage object: "..tostring(msg).."\nChannel: "..tostring(channel.id))
if not tried then if not tried then
log("INFO","Retrying...") log("CRON","Retrying...")
timer.setTimeout(2000,function() timer.setTimeout(2000,function()
sync_emitter:emit("execContext",function() sync_emitter:emit("execContext",function()
exec(v,command,true) exec(v,command,true)
@ -60,7 +60,7 @@ exec = function(v,command,tried)
log("ERROR","Unable to retrieve event creator: "..tostring(v.user)) log("ERROR","Unable to retrieve event creator: "..tostring(v.user))
log("ERROR","Failed event: "..command) log("ERROR","Failed event: "..command)
if not tried then if not tried then
log("INFO","Retrying...") log("CRON","Retrying...")
timer.setTimeout(2000,function() timer.setTimeout(2000,function()
sync_emitter:emit("execContext",function() sync_emitter:emit("execContext",function()
exec(v,command,true) exec(v,command,true)
@ -225,6 +225,7 @@ register_event = function(k,v,timer,evname)
print(v.comm) print(v.comm)
return false,k return false,k
end end
log("CRON","Loaded event "..k)
return true,k return true,k
end end
@ -232,7 +233,7 @@ end
for k,v in pairs(config.events.timer) do for k,v in pairs(config.events.timer) do
local ev,hash = register_event(k,v,true) local ev,hash = register_event(k,v,true)
if (not ev) then if (not ev) then
log("INFO","Retrying event "..k.." in 2 seconds") log("CRON","Retrying event "..k.." in 2 seconds")
timer.setTimeout(2000,function() timer.setTimeout(2000,function()
sync_emitter:emit("execContext",function() sync_emitter:emit("execContext",function()
register_event(k,v) register_event(k,v)
@ -247,7 +248,7 @@ for _,evtype in pairs(config.events.event) do
for k,v in pairs(evtype) do for k,v in pairs(evtype) do
local ev,hash = register_event(k,v,true) local ev,hash = register_event(k,v,true)
if (not ev) then if (not ev) then
log("INFO","Retrying event "..k.." in 2 seconds") log("CRON","Retrying event "..k.." in 2 seconds")
timer.setTimeout(2000,function() timer.setTimeout(2000,function()
sync_emitter:emit("execContext",function() sync_emitter:emit("execContext",function()
register_event(k,v) register_event(k,v)
@ -369,7 +370,7 @@ timer:on("min",function()
for k,v in pairs(events.timer) do for k,v in pairs(events.timer) do
local status,command = v.comm(os.date("*t")) local status,command = v.comm(os.date("*t"))
if status then if status then
sync_emitter:emit("executeCommand",v,command) exec(v,command)
if v.type == "onetime" then if v.type == "onetime" then
events.timer[k] = nil events.timer[k] = nil
config.events.timer[k] = nil config.events.timer[k] = nil

View File

@ -16,7 +16,7 @@ return {
} }
}}, }},
["pfp"] = "Show the profile picture of a user, or if none is specified, of yourself", ["pfp"] = "Show the profile picture of a user, or if none is specified, of yourself",
["markpov"] = { embed = { ["markov"] = { embed = {
title = "Generate some text using markov chains", title = "Generate some text using markov chains",
description = "Generates text using the markov chain rule applied to a predefined set of words", description = "Generates text using the markov chain rule applied to a predefined set of words",
fields = { fields = {