Snips
A snip is a saved message with a name that you can send instantly in any chat. It's useful for replies you repeat a lot: a greeting, the group rules, a sticker, a GIF.
Saving a snip
| What you do | Result |
|---|---|
.snip name replying to a message |
Saves that message |
.snip name text |
Saves that text |
.snip name replying to an album |
Saves all the files of the album in a single snip |
.snipadd name replying to a file or album |
Adds files to a snip that already exists |
You can save:
- Text, with its formatting (bold, italics, links...)
- Photos, videos, GIFs and stickers
- Voice notes, video notes, audios and files (with their caption, if they have one)
You can't save polls, locations or contacts. KitDev warns you.
The name: letters, numbers, _ and -, up to 32 characters. Case-insensitive. If you save another snip with a name that already exists, it replaces it. If you type .snip $name, the $ is ignored.
In .snip name text, the formatting you apply with Telegram's menu is kept, but markdown typed by hand (**like this**) is saved as is. For a formatted text, write it in a message, apply the formatting and reply to that message with .snip name.
Several files in a single snip (album)
You can save up to 10 files in a snip and they will be sent together, as an album:
- All at once: reply to a Telegram album with
.snip nameand all its files are saved, with their caption. - Little by little: save the first file with
.snip nameand keep adding the others with.snipadd name, replying to each one. If the snip was text, that text becomes the album's caption.
Telegram doesn't let you mix just anything in an album: you can combine photos and videos, or only files, or only audios. Stickers, GIFs, voice notes and video notes don't go in albums; KitDev warns you if you try to combine them. The caption is shown on the first file.
.snips marks them as album of 4 files. To change an album, save it again with .snip name: it replaces the previous one.
Sending a snip
Type $name in any chat. KitDev sends the snip and deletes your message. $snip name also works.
- If you reply to another message when typing
$name, the snip is sent as a reply to that message. - In groups with topics, it is sent in the same topic.
- If the name doesn't exist, nothing happens: your message stays as you wrote it. That way you can write things like
$5without problems.
Viewing and deleting
| Command | What it does |
|---|---|
.snips |
Lists the saved snips, with their type ($greeting · text). If there are many, it cuts the list and says how many are missing |
.delsnip name |
Deletes a snip |
Where they are stored
In the SQLite database data/kitdev.sqlite3, in its own table. It needs no external service. It is in the .gitignore: it is not uploaded to Git. Make a copy of data/ if you change servers.
For media files, the Telegram reference (file_id) is stored, not the file. That reference belongs to your userbot account: if you change account or session, snips with media stop being sent and text ones keep working. In that case, save them again.