Compare commits

..

No commits in common. "29a21a2f8f64e6ce67583f360e633144e0ddfa23" and "aaa4b992f85ddb929cb3d8fac86260b2b7886996" have entirely different histories.

2 changed files with 3 additions and 22 deletions

View File

@ -1,7 +1,7 @@
return function(message,overrides) return function(message,overrides)
assert(type(message) == "table","table expected, got "..type(message)) assert(type(message) == "table","table expected, got "..type(message))
assert(type(overrides) == "table","table expected for arg#2, got "..type(overrides)) 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, author = message.author,
member = message.guild:getMember(message.author.id), member = message.guild:getMember(message.author.id),
channel = message.channel, channel = message.channel,
@ -40,28 +40,9 @@ return function(message,overrides)
message:removeReaction(...) message:removeReaction(...)
end, end,
emulated = true emulated = true
}]] }
local fake = {}
for k,v in pairs(overrides) do for k,v in pairs(overrides) do
fake[k] = v fake[k] = v
end 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 return fake
end end

@ -1 +1 @@
Subproject commit 4c796978eb2ca1e54d0ed357820610e09f30e8ef Subproject commit 8a1906df7a402349ff7b083e59cf17223363f59b