Added back messageOnce event

This commit is contained in:
Yessiest 2022-05-18 02:14:59 +04:00
parent 121e1ec6d1
commit 435ca7de9d
1 changed files with 5 additions and 6 deletions

View File

@ -125,8 +125,6 @@ end
local remove_user_event = function(user_id,id) local remove_user_event = function(user_id,id)
for k,v in pairs(config.events.timer) do for k,v in pairs(config.events.timer) do
print(v.user,tostring(user_id))
print(k,id,compids(k,id))
if compids(k,id) and (v.user == tostring(user_id)) then if compids(k,id) and (v.user == tostring(user_id)) then
config.events.timer[k] = nil config.events.timer[k] = nil
events.timer[k] = nil events.timer[k] = nil
@ -135,8 +133,6 @@ local remove_user_event = function(user_id,id)
end end
for evname,evtype in pairs(config.events.event) do for evname,evtype in pairs(config.events.event) do
for k,v in pairs(evtype) do for k,v in pairs(evtype) do
print(v.user,tostring(user_id))
print(k,id,compids(k,id))
if compids(k,id) and (v.user == tostring(user_id)) then if compids(k,id) and (v.user == tostring(user_id)) then
config.events.event[evname][k] = nil config.events.event[evname][k] = nil
events.event[evname][k] = nil events.event[evname][k] = nil
@ -360,9 +356,12 @@ client:on("messageCreate",function(msg)
end end
for k,v in pairs(events.event.messageOnce or {}) do for k,v in pairs(events.event.messageOnce or {}) do
local status,command = v.comm({content,user,channelid}) local status,command = v.comm({content,user,channelid})
if status then
exec(v,command)
events.event.messageOnce[k] = nil events.event.messageOnce[k] = nil
config.events.event.messageOnce[k] = nil config.events.event.messageOnce[k] = nil
end end
end
end) end)
timer:start(true) timer:start(true)