KitDevguides

KitDev / Guides / Addons

Addons

An addon is an extra plugin that is installed without touching the code. The official addons live in kitdev/addons/ (the dev uploads them to the channel from there; that folder is not loaded by itself). They are stored in data/addons/ (not uploaded to Git) and appear in .help → 🧩 Addons.

Two ways to install them

1. Replying to their file with .install

You reply to a .py file with .install and it is loaded, without restarting. It needs dev mode active. More details in Plugins.

2. From the official channel: @addons_kitdevs

The official addons are published there as .py files. For your userbot to install and update them by itself, enable it in one of these ways:

.setdb Addons true        (needs dev mode; takes priority over the .env)

or in the .env:

ADDONS=true
  • It syncs shortly after starting and then every 6 hours. .addons sync does it right now.
  • Each file goes through the same security review as .install. High warnings (eval, os.system, reading the session…) block the installation and tell you why; medium ones (using the internet, reading environment variables) are accepted and noted in the console, because the file comes from the official channel. With .install by hand, any warning asks for .install force.
  • Those that use the name of a built-in plugin, repeat commands that already exist, are too big or fail to load are skipped. If an update fails, the version that already worked is kept.
  • An addon that you installed by hand with .install is not touched.
  • If you remove with .uninstall one that came from the channel, it doesn't come back by itself. To bring it back: .addons install name.
  • To update an addon, the dev uploads the file again with the same name (or edits the message): at the next sync it is updated.
  • To turn it off: .setdb Addons false. The channel can be changed with ADDONS_CHANNEL in the .env.

What the channel publishes runs with access to your account, like any plugin. Trust only the official channel and keep the account that manages it protected (two-step verification).

Commands

Command What it does
.addons Shows the channel, whether sync is active and the installed addons (🌐 = they come from the channel)
.addons sync Looks for new or updated addons in the channel (dev mode)
.addons install name Reinstalls a channel addon you removed (dev mode)
.install / .uninstall name Installs (replying to a .py) or removes an addon (dev mode)

Official addons

typewriter: .type

Types a text like a typewriter: it edits your message and adds one letter every 3 seconds, with a ▒ cursor that disappears when it finishes.

.type hola
  • Maximum 200 characters.
  • The speed is changed with .setdb type_delay 0.5 (between 0.5 and 10 seconds per letter; below 0.5 Telegram limits edits).
  • If you delete the message while it is typing, it stops.

Its code is in kitdev/addons/typewriter.py.

fakeaction: fake actions in the chat

Shows at the top of the chat "typing…", "sending a photo…", "recording audio…", etc., while you're doing none of that. The command deletes itself.

.ftyping 30      typing… for 30 seconds (also 30s or 2m; default 10, max. 10 min)
.fstop           stops the action in that chat
Command Action seen
.ftyping Typing…
.fphoto Sending a photo…
.fvideo Sending a video…
.frecvideo Recording a video…
.frecaudio Recording an audio…
.fsendaudio Sending an audio…
.fdocument Sending a file…
.fround Recording a round video…
.fgame Playing…
.fsticker Choosing a sticker…
.flocation Choosing a location…
.fcontact Choosing a contact…

All accept the duration (.fphoto 45, .fgame 2m). There is only one action per chat: using another replaces the previous one, and each chat has its own. It works in groups and private chats. Telegram only shows the action for about 5 seconds, so KitDev repeats it every 4 until the time runs out.

quote: .q

Quotes messages as a sticker, with the LyoSU/quote-api API.

.q            replies to a message and quotes it
.q 3          quotes 3 consecutive messages, from the one you reply to (max. 10)
.q #1b1429    changes the background (also #111/#333, random or a color like blue)
.q r          includes the message the quoted one was replying to

.quote does the same. It respects names, styles (bold, italics, links…), premium emojis and the status emoji. A message without text comes out with a label (📷 Photo, 🎬 Video…); in this version photos and stickers are not drawn inside the quote. The avatar is taken from the public photo of whoever has a username; otherwise, the API draws their initial.

API. By default it uses LyoSU's public instance, https://quote.yuri.ly/quote/generate: it doesn't guarantee stability and limits to 20 requests per 55 seconds per IP. If you prefer your own API, change the URL with:

.setdb QuoteApi http://localhost:3000/generate

(.deldb QuoteApi goes back to the public one.) To have it locally you must clone and start quote-api (Node 22 or higher):

git clone https://github.com/LyoSU/quote-api.gitcd quote-apinpm installBOT_TOKEN=<token de cualquier bot> node index.js   # o con pm2 / Docker

The BOT_TOKEN is used by the API to draw premium emojis. KitDev never sends any token to the API.

If it says «method not found»: the API takes the method from the end of the URL and only recognizes generate. The addon tries the two usual forms by itself (…/generate and …/quote/generate) and remembers the one that works; if neither works, the message shows the URLs it tried. See yours with .getdb QuoteApi and, if you no longer need your own, .deldb QuoteApi.

Publishing an addon (for the dev)

  1. Write the addon as a normal plugin (@cmd(...), see Plugins), with the path on the first line (# kitdev/addons/name.py).
  2. The file name is the addon's name: lowercase, numbers and _ (maximum 32). One addon per file.
  3. Upload it to the channel as a document. Avoid what the review flags (eval, subprocess, os.system…) or the addon will be skipped on userbots.
  4. For .help name to explain the addon, define ADDON_HELP: a text or a dict per language ({"es": "...", "en": "..."}), with {prefix} where the prefix goes and simple HTML (<code>). It is shown under the title, before the command list, and must fit in about 700 characters.
  5. Official addons carry the signature ADDON_CREDIT = "© @kitDev_userbot" (official channel: @kitDev_userbot). If you define ADDON_CREDIT, .help name shows it at the foot of the addon's help. Built-in plugins show the project's same signature at the foot of their help.
  6. The texts go inside the addon (it can't add keys to the JSONs). The current language is read with settings.get("lang").