pf03 / newBot

BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

BOT


ORDER OF LAUNCH AND TESTING

  1. Run commands:
    • git clone https://github.com/pf03/newBot.git
    • cd bot
    • stack build
  2. To run the binary file successfully, copy the following files and folders from repository into the same folder with the binary file:
    • config-example.json
  3. Rename the config-example.json file to config.json and edit it Be sure to edit the following fields:
    • apps.token
    • apps.groupId for VK

The fields apps.repeatNumber and apps.updateId can be left as they are, they will be filled in while the bot is running.

  1. For the correct launch of the bot for VK, you must select Work with API -> Long Poll API -> Event types -> Incoming message in the community settings. The rest of the checkboxes shouldn't be checked.

vk bot settings

  1. To test pure functions run stack test

CONFIG

Purpose of config.json fields:

FUNCTIONAL

The main function of an echo bot is to send the same message to the user in response to a message a specified number of times. The bot also supports some commands (see the list below). Two messengers are supported - Telegram, VK.

Message types for the Telegram messenger:

Message types for the VK messenger:

COMMANDS