cl-telegram-bot
cl-telegram-bot copied to clipboard
Private chat limitation
Hello,
Currently make-chat
ensures we create a private chat:
Only private chats are supported for now.
So we can't use the bot on a public group or on a private channel. As far as my tests went, we can only interact directly with it as 1to1 (which is cool).
Do you know what's required to bypass this limitation? (I didn't check the API docs yet)
thanks
As I recall, make-chat
creates a chat.
Did you try to add a bot into an existing group chat? I think this should work.
yes I tried to add the bot into a public group and into a channel. I get the error.
(defun make-chat (data)
(unless (string-equal (getf data :|type|)
"private")
(error "Only private chats are supported for now.")) ;;; <------------------------- won't pass
(make-instance 'private-chat
:id (getf data :|id|)
:username (getf data :|username|)
:first-name (getf data :|first_name|)
:last-name (getf data :|last_name|)
:raw-data data))
I didn't try by removing the error creation.
I deleted it and tried, then:
An HTTP request to "https://api.telegram.org/bot2051825788:AAEQqIEqUtc49MMJDOg-EgK-KVziXq3ol6w/sendMessage" returned 403 forbidden.
{"ok":false,"error_code":403,"description":"Forbidden: bot was kicked from the group chat"}
[Condition of type DEXADOR.ERROR:HTTP-REQUEST-FORBIDDEN]
and this or the error happen everytime I start the bot. I might need to properly remove it from the group and channel, but I think it is…
oh cool, by accepting and continuing I found the continue-processing
restart to continue accepting Telegram updates, now it works again (in private 1-1 conversation). +1
I deleted the error
, now I can add the bot into a new group. It… works.
Commands work. A detail though. When the bot prints the start message, if we click on a command, then the command is complemented with an explicit mention of the bot, like so:
/cmd@my_bot
so to catch this we have to dispatch on the on-message
method (thank you to the default help text).
Testing more.
Good. Feel free to create a pull-request to add groups support.