2
votes

i'm trying to create a chess bot to play with other users on the workspace. I can't figure out how to create a private conversation including 2 users (the 2 players) and the bot user. To play in private.

I tried to use the slack api but it does not work.

1
I saw this doc. But i can't invite my bot. - Jeremy M.
That is a different issue, please clarify your question. To my understand you're asking for help "to create a private conversation including 2 users" - jsarbour
it's clearly asked "2 users and the bot user". - Jeremy M.
Then I am not clear on your issue. What is the problem that you are having? - jsarbour

1 Answers

2
votes

I would recommend using a "multi-person direct message" (MPIM). It allows you to create a new / or join an existing direct message channel with multiple users, e.g. 2 players and your bot user.

A MPIM is different from a private channel as it does not require a dedicated name and you can create multiple in the same workspace as long as it contains a different set of users.

To open a MPIM call the API method conversations.open with your bot user token and provide the user IDs of the two users in the users parameter. You will get a channel ID in return, which you can use later to resume the conversation. Alternatively you can just open it again with the same list of users.