Project

General

Profile

Feature #3170

Updated by Gregory Magarshak 7 months ago

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, By default, 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 simply open that en.json file and use that path. 

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

 In Telegram plugin, from Telegram/text/en.json  

 Also implement the approveChatJoinRequest method of Telegram_Bot 

 In the app, when 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.

Back