World Conquest Chronicles

World Conquest Chronicles

VK Bot, v1.2.0

Conversation with the bot

Extendable VK group bot.

Add special responses and correct a logging.

Change Log

  • Closed issues:
    • Special responses:
      • Support a request of a join to the group #15
      • Support a preliminary response about a receiving of a message for a processing #10
    • Log:
      • Use the error log level for a cache save error #14
      • Log stderr of an outer command #13
      • Log about a response sending #12
    • Simplify an environment variables processing #16
  • Fixed bugs:
    • Use the error log level for the global error message #11

Features

  • listen inbox messages via the long polling technology;
  • process messages by the specified outer command:
    • serialize a message object (see below for details) to the JSON format;
  • special responses:
    • request of a join to the group;
    • preliminary response about a receiving of a message for a processing;
  • attachments:
    • support attachments in a response (see below for details);
    • automatically load attachments from a command response;
    • cache loaded attachments:
      • search in a cache by:
        • attachment path;
        • attachment basename.

Usage

$ vk-bot --version
$ vk-bot --help

Options:

  • --version — show version number;
  • --help — show help.

Environment variables:

  • VK_BOT_TOKEN — VK API access token;
  • VK_BOT_GROUP — ID or screen name of the group;
  • VK_BOT_COMMAND — messages process command;
  • VK_BOT_CACHE — file where to persist cached attachments (default: ~/.vk-bot/attachments.json);
  • VK_BOT_INEXACT_CACHE — search attachments in a cache only by its basenames (allowed: TRUE);
  • VK_BOT_LOG — file where to persist a log (default: ~/.vk-bot/logs/app.log);
  • VK_BOT_PRELIMINARILY — preliminary response about a receiving of a message for a processing (default: Hello! Your message is being processed. Please, wait.);
  • VK_BOT_REQUIRE_JOIN — require join to the group before start a conversation (allowed: TRUE);
  • VK_BOT_JOIN_REQUEST — request of a join to the group (default: Hello! To talk to me, please, join my group.).

Environment variables can be specified in a .env file in the project folder in the format:

NAME_1=value_1
NAME_2=value_2
...

See details about the format: https://github.com/motdotla/dotenv#rules.

A .env file will never modify any environment variables that have already been set.

Repository

Link: https://github.com/thewizardplusplus/vk-bot/tree/v1.2.0.

Content: code.

License: MIT.

Screenshots

Help message

Help message

Messages processing

Messages processing

Request of a join to the group

Request of a join to the group

Copyrights