Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Private chat limitation #5

Open
vindarel opened this issue Oct 28, 2021 · 6 comments
Open

Private chat limitation #5

vindarel opened this issue Oct 28, 2021 · 6 comments

Comments

@vindarel
Copy link

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

@svetlyak40wt
Copy link
Member

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.

@vindarel
Copy link
Author

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.

@vindarel
Copy link
Author

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…

@vindarel
Copy link
Author

vindarel commented Oct 28, 2021

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

@vindarel
Copy link
Author

vindarel commented Oct 28, 2021

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.

@svetlyak40wt
Copy link
Member

Good. Feel free to create a pull-request to add groups support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants