Bot Write AccessBOT-ONLY
Bot Walkthrough 16 of 18
Bots can detect when a user allows them to send messages.
Handling Write Access
Handle message:writeAccessAllowed to receive the service message.
client.on("message:writeAccessAllowed", (ctx) => {
const { miniAppName } = ctx.msg.writeAccessAllowed;
console.log(
miniAppName ? `Write access granted through ${miniAppName}` : "Write access granted",
);
});
miniAppName is present when access was granted through a Mini App.