Compare commits
No commits in common. "29a21a2f8f64e6ce67583f360e633144e0ddfa23" and "aaa4b992f85ddb929cb3d8fac86260b2b7886996" have entirely different histories.
29a21a2f8f
...
aaa4b992f8
|
@ -1,7 +1,7 @@
|
|||
return function(message,overrides)
|
||||
assert(type(message) == "table","table expected, got "..type(message))
|
||||
assert(type(overrides) == "table","table expected for arg#2, got "..type(overrides))
|
||||
--[[local fake = {content = message.content,
|
||||
local fake = {content = message.content,
|
||||
author = message.author,
|
||||
member = message.guild:getMember(message.author.id),
|
||||
channel = message.channel,
|
||||
|
@ -40,28 +40,9 @@ return function(message,overrides)
|
|||
message:removeReaction(...)
|
||||
end,
|
||||
emulated = true
|
||||
}]]
|
||||
local fake = {}
|
||||
}
|
||||
for k,v in pairs(overrides) do
|
||||
fake[k] = v
|
||||
end
|
||||
fake = setmetatable(fake, {
|
||||
__index = function(self,k)
|
||||
local value = rawget(self,k)
|
||||
if not value then
|
||||
value = message[k]
|
||||
if type(value) == "function" then
|
||||
return function(x,...)
|
||||
if not x then error("self expected, got nil") end
|
||||
return value(message,...)
|
||||
end
|
||||
else
|
||||
return value
|
||||
end
|
||||
else
|
||||
return value
|
||||
end
|
||||
end
|
||||
})
|
||||
return fake
|
||||
end
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 4c796978eb2ca1e54d0ed357820610e09f30e8ef
|
||||
Subproject commit 8a1906df7a402349ff7b083e59cf17223363f59b
|
Loading…
Reference in New Issue