Attempt to call upvalue 'Message' (a table value)

437 Views Asked by At

So, I'm working on Discord API wrapper written in Lua, but there's an issue, I use rxi's classic module for creating classes and objects, every class works fine, instead of the one class, Message, while trying to create a message in Interaction module.

Github repo : https://github.com/RealJace/discord.lua

Thank's for any help.

NOTE : Every class that's being created is defined in original code but I had to remove them from codeblocks so StackOverflow let's me post this
NOTE 2 : Object class is the rxi's classic

1

There are 1 best solutions below

3
Piglet On

Here you're calling Message:

self.message = Message(self.d["message"])

Message is a table value and does not have a metatable implementing the __call metamethod.

Either don't attempt to call it or ensure it can be called.