WVDevel Community Assistant for Telegram
WVDevel Community Assistant for Telegram
Description
This plugin connects a Telegram bot to your WordPress site to support
the community or group you manage:
- Validates every Telegram user against the plugin’s own database
table (username, Telegram ID and an access code). The code is stored
encrypted with AES-256-GCM (authenticated encryption) using the
security keys from your ownwp-config.php, and is managed from a
screen in the WordPress admin, with no loose JSON files. - If a user is not validated, the bot does not reply at all -except
for a single private notice the first time they write- so no
information is exposed and no spam is generated. - In a group, the bot only replies if it is mentioned (@bot username,
replying to one of its messages, or with a command directed at it).
In private chats it always replies, to already validated users. - Includes configurable general commands:
/reglas,/horario,
/anuncios,/recursos,/ayuda,/misdatos-all editable from
the WordPress admin, without touching code. - Includes moderation commands for administrators, private chat only:
/validar,/invalidar,/listar,/anunciar,/stats. - “Mis recursos”: each validated user can have a carnet (student/member
code). Files uploaded per carnet from the “Recursos por usuario” admin
screen are offered to that user -and only that user- when they send
/recursos in a private chat: one button per file plus a “download
all” button that sends a ZIP. The files are stored in a private,
web-inaccessible folder and are delivered straight to Telegram, never
through a public URL. - Integrates an Ollama (conversational AI) client that is already
built but disabled by default: once your Ollama server is ready,
just enable the checkbox and set the URL/model in Settings. Until
then the bot replies with a notice instead of failing.
Use cases
Built for any Telegram community that needs to moderate access and
automate replies: study groups, communities of practice, work teams,
clubs or product support.
External services
This plugin connects to the following external services to work:
- Telegram Bot API (
https://api.telegram.org) – required for the
bot to function. The plugin sends your bot token and the text
messages exchanged with Telegram users (inbound and outbound) so it
can receive and reply to messages via webhook. Subject to Telegram’s
Terms of Service and
Privacy Policy. - Ollama (URL you configure, typically your own server) – optional
and disabled by default. If you enable it, the text of messages from
validated users is sent to the URL you configure to generate an AI
reply. No information is sent to any third-party server other than
the one you specify in Settings.
Requirements
- WordPress 5.8 or higher.
- PHP 7.4 or higher, with the
opensslextension enabled. - A site with valid HTTPS (Telegram does not accept webhooks over
http://). - A bot created with @BotFather on Telegram.
Installation
- Upload the full plugin folder to
wp-content/plugins/, or zip its
contents and use Plugins -> Add New -> Upload Plugin from the
WordPress admin. - Activate “WVDevel Community Assistant for Telegram” in Plugins.
On activation, the required database tables and a random webhook
secret are created automatically. - Go to Bot Telegram -> Ajustes (Settings):
- Paste the bot token (obtained from @BotFather) and save the
settings. It is encrypted before being saved. - Click “Configurar Webhook” to register your site with Telegram.
- Add the group ID under “Grupos permitidos” and your own Telegram
ID under “IDs de administradores”. - Edit the
/reglas,/horario,/anunciosand/recursostexts
with your community’s actual content.
- Paste the bot token (obtained from @BotFather) and save the
- Go to Bot Telegram -> Usuarios validados and register each
member (Telegram ID, username, name and access code). You can also
do this from Telegram with/validar [id] [codigo] [usuario]in a private chat with the bot, once your ID is in the
[nombre]
administrators list. - (Optional) “Mis recursos” – personal files per member:
- In Bot Telegram -> Ajustes, section “4. Mis recursos”,
keep “Activar” checked (it is on by default), optionally edit
the intro text and the per-file size limit. - In Bot Telegram -> Usuarios validados, fill the Carnet
field for each member (their student/member code). This is the
key that links a person to their folder of files. - In Bot Telegram -> Recursos por usuario, type a carnet and
upload one or more files for it. They are stored in a private
folder insidewp-content/uploadsthat is not reachable from
the web. - The member writes
/recursosin a private chat with the
bot: after the general text they get a button per file (tap to
download) and, if there are two or more, a “download all”
button that sends a ZIP.
- In Bot Telegram -> Ajustes, section “4. Mis recursos”,
- (Optional, later) Enable Ollama in Settings once your server is
running, providing its URL and the model to use.
Faq
Assign a carnet to a member under “Usuarios validados”, upload
files for that carnet under “Recursos por usuario”, and the member
receives them by writing /recursos in a private chat with the bot.
Each file is a button; a “download all” button sends a ZIP. It only
works in private chats, never in the group.
They are saved in wp-content/uploads/wvdevel-mis-recursos-<random>/,
protected with a “deny from all” .htaccess/web.config and an
unguessable random folder name. The plugin never exposes a public URL:
it uploads each file straight to Telegram, and only to the member
whose carnet matches. Deleting the plugin removes the whole folder.
Check that: the feature is enabled in Settings; the member has a
Carnet set that exactly matches the one used when uploading; there
is at least one file for that carnet; and they are writing /recursos
in a private chat, not in the group.
No. The Ollama client is disabled by default. While it is off, the
bot still validates users and replies to the configured commands
(/reglas, /horario, etc.); only free-form natural language
questions get a notice that AI is not configured yet.
Forward any message from the group to a bot such as @userinfobot, or
check the first message the group sends to the bot after configuring
the webhook (it appears in the WordPress logs if something fails).
The access code and the bot token are encrypted with AES-256-GCM
(authenticated encryption) using the AUTH_KEY / SECURE_AUTH_KEY
keys from your own wp-config.php before being saved. They are never
stored in plain text or in loose files.
No. In a group it only replies if it is mentioned directly (@bot
username, replying to one of its messages, or with a command directed
at it). Any other message in the group is completely ignored.
Yes, add the Telegram IDs separated by commas under “IDs de
administradores” in Settings.
Nothing is deleted: the webhook, the settings and the validated users
are kept. They are only removed completely if you use
Plugins -> Delete, which runs the definitive cleanup of tables and
settings.
Reviews
Changelog
1.1.0
- New “Mis recursos” feature: per-carnet personal files. Adds a “carnet”
field to validated users, a “Recursos por usuario” admin screen to
upload/delete files per carnet, and extends/recursosso that in a
private chat the bot also lists the user’s files with inline buttons
(download one by one, or “download all” as a ZIP). - Files are kept in an unguessable folder inside uploads, locked down
with a Deny-from-all.htaccess/web.config, and are uploaded to
Telegram via multipart -no public URL is ever exposed. - The bot now handles Telegram
callback_queryupdates (inline button
presses), restricted to private chats and validated users. - Uninstalling now also drops the
wvdevel_resourcestable and removes
the private resources folder.
1.0.0
- Initial release: encrypted user validation (AES-256-GCM), REST
webhook protected with a secret_token, configurable general
commands, private moderation commands, a message log screen with
search and per-conversation deletion, an administrators screen, a
broadcast screen for sending messages/attachments to validated
users and/or allowed groups, and an Ollama client ready to be
enabled.