Timed messages
A bot can post a message that the server deletes after a set time: a reminder that cleans itself up, a one-hour invite, a raid call that disappears with the raid. Available from Mnema Talk 3.2.
Send one
POST /api/bot/v1/channels/{id}/messages takes an optional lifetime_seconds: 60 to 2,592,000 (30 days), and at most the ceiling the community set. The server deletes the message that long after it was sent.
{"content": "Raid lobby is open, join in the next hour", "lifetime_seconds": 3600}
- The answer, the gateway events and every read carry
expires_at(RFC 3339) on such a message; reads leave it out once that time has passed. 400when lifetimes are switched off in the community, or the value is out of bounds.- The lifetime is fixed when the message is sent and cannot be changed by an edit.
- Pinning or forwarding a message with a lifetime is refused.
- Incoming webhooks do not accept a lifetime: their channel is better served by the channel's auto-delete.
In the SDKs (TypeScript @mnema-xyz/bot-sdk from 3.4.0, Go from v0.1.0):
await client.rest.createMessage(channelId, { content: 'Lobby open for an hour', lifetime_seconds: 3600 })
_, err := c.REST.CreateMessage(ctx, channelID, mnema.MessageCreate{Content: "Lobby open for an hour", LifetimeSeconds: 3600})
What a lifetime is not
A lifetime decides when the server deletes a message. It does not protect it from anyone who could read it before:
- Members can copy, quote or screenshot it, and a client that does not follow the rules (an old app, a script, a bot) need not hide it.
- Text is not end-to-end encrypted: the server can read it while it exists, and backups made meanwhile keep it.
- A push notification already delivered stays on the device. A message with a lifetime under 10 minutes is pushed as "New message" alone, without text, sender or channel.
- A report filed before the end keeps its copy for the moderators, and a data export taken before the end contains it.