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 own wp-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.
  • 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 openssl extension enabled.
  • A site with valid HTTPS (Telegram does not accept webhooks over
    http://).
  • A bot created with @BotFather on Telegram.

Installation

  1. Upload the full plugin folder to wp-content/plugins/, or zip its
    contents and use Plugins -> Add New -> Upload Plugin from the
    WordPress admin.
  2. Activate “WVDevel Community Assistant for Telegram” in Plugins.
    On activation, the required database tables and a random webhook
    secret are created automatically.
  3. Go to Bot Telegram -> Ajustes (Settings):
    1. Paste the bot token (obtained from @BotFather) and save the
      settings. It is encrypted before being saved.
    2. Click “Configurar Webhook” to register your site with Telegram.
    3. Add the group ID under “Grupos permitidos” and your own Telegram
      ID under “IDs de administradores”.
    4. Edit the /reglas, /horario, /anuncios and /recursos texts
      with your community’s actual content.
  4. 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]
    [nombre]
    in a private chat with the bot, once your ID is in the
    administrators list.
  5. (Optional, later) Enable Ollama in Settings once your server is
    running, providing its URL and the model to use.

FAQ

Do I need Ollama running to use the plugin?

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.

How do I get the numeric ID of the Telegram group?

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).

Is it safe to store members’ access codes in the database?

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.

Does the bot reply to every message in the group?

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.

Can I have more than one administrator?

Yes, add the Telegram IDs separated by commas under “IDs de
administradores” in Settings.

What happens if I deactivate the plugin?

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

There are no reviews for this plugin.

Contributors & Developers

“WVDevel Community Assistant for Telegram” is open source software. The following people have contributed to this plugin.

Contributors

Changelog

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.