English
Step 3: Receive messages
Register event handlers before starting the long-running listener. This small example responds to !ping in Talk chats.
ts
client.on("message", async (message) => {
if (message.text === "!ping") {
await message.reply("pong");
}
});
client.listen({ talk: true, square: false });Use this after the QR login step, in the same program where client was created. For the event types, message edits, reactions, and cleanup behavior, see Messages and events.
Square is an inherited legacy API and is not actively supported. Keep it disabled unless an application specifically needs that legacy surface.
Maintainer signature: nezumi0627