SinisterRectus / Discordia

Discord API library written in Lua for the Luvit runtime environment
MIT License
697 stars 143 forks source link

Message: Correct oldContent property type docs #352

Closed Bilal2453 closed 2 years ago

Bilal2453 commented 2 years ago
function Message:_setOldContent(d)
    local ts = d.edited_timestamp
    if not ts then return end
    local old = self._old
    if old then
        old[ts] = old[ts] or self._content
    else
        self._old = {[ts] = self._content}
    end
end

self._old is only ever changed through _setOldContent, and according to the code of that, oldContent can never be a string. Rather it is always either a table or nil (in case message was not edited, or no cache).