Project

General

Profile

Actions

Feature #3170

open

Homework 3: Gatekeeper bot

Added by Gregory Magarshak 7 months ago. Updated 7 months ago.

Status:
Needs review
Priority:
High
Start date:
10/21/2024
Due date:
10/28/2024 (about 7 months late)
% Done:

0%

Estimated time:
1.00 h

Description

Make your bot into a gatekeeper.

It has to listen for chat_join_request events, and handle them with canonical Qbix style. Just add the handlers inside the Telegram/handlers and name them appropriately.

The default handler, it check Q_Config::get('Telegram', 'bot', 'messages', 'chatJoinRequest', null) and if it exists, it will be fed to Q::text(). Typically it would be ["Telegram/content", ["chatJoinRequest", "Welcome"]] and that will mean open that en.json file and use that path.

If it is not null, then the bot will a chat to the user (using the private chat id) and send some welcome message by just calling Q::text($params).

In Telegram plugin, implement the approveChatJoinRequest method of Telegram_Bot

In the app, when the user answers, you can call this approveChatJoinRequest (in the app handler, not Telegram plugin)

Telegram plugin must have generic code. App handler can override / handle some events.

Actions #1

Updated by Gregory Magarshak 7 months ago

  • Description updated (diff)
Actions #2

Updated by Artem Subbotin 7 months ago

  • Status changed from New to Needs review
  • Assignee changed from Artem Subbotin to Gregory Magarshak

Commit: 09285d4a2c8feae3a599435538f19c950a0b32aa

Actions

Also available in: Atom PDF