Add __tostring metamethods to prototypes
This is nice to have, and aids with debugging and interactive usage.
This commit is contained in:
@@ -18,8 +18,13 @@ local CqHttpClient = {
|
||||
quote = function (self, text) return encodeURI(text) end,
|
||||
unquote = function (self, text) return decodeURI(text) end,
|
||||
}
|
||||
CqHttpClient.__name = "matrix.factory.chttp"
|
||||
CqHttpClient.__index = CqHttpClient
|
||||
|
||||
function CqHttpClient:__tostring()
|
||||
return self.__name
|
||||
end
|
||||
|
||||
|
||||
local function headers_to_dict(h)
|
||||
local headers = {}
|
||||
|
||||
Reference in New Issue
Block a user