#Error getting chat obj from message

7 messages · Page 1 of 1 (latest)

neon canopy
#

@hoary ferry sorry for the ping but i need a resolution, please

tepid cipher
#

Update to v1.23.1-alpha.0

neon canopy
elfin olive
#

You put const
chat=await message.getChat()
below client.on(message) ?

low plover
#

Message seem to be null check if you have the right variable name and if it's under client.on message like Walace said

neon canopy
# elfin olive You put const chat=await message.getChat() below client.on(message) ?

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()
...
}