#Error getting chat obj from message
7 messages · Page 1 of 1 (latest)
Update to v1.23.1-alpha.0
npm install [email protected]
doesn't solve it, the problem continues to exist every time you receive a message
You put const
chat=await message.getChat()
below client.on(message) ?
Message seem to be null check if you have the right variable name and if it's under client.on message like Walace said
the constant declaration is in a function that is called in client.on("message", (message) => {
handler(client,message)
});
async function handler(client, message, isOnStart) {
if (message === undefined||message===null) return
if (message.author === undefined) return
const {from,to,author,mentionedIds,links,timestamp,isForwarded,hasQuotedMsg}= message
console.log(message.body)
const chat=await message.getChat()
...
}