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

Fail to send a message to a team with a restricted bot #250

Open
tdeheurles opened this issue May 12, 2021 · 0 comments
Open

Fail to send a message to a team with a restricted bot #250

tdeheurles opened this issue May 12, 2021 · 0 comments

Comments

@tdeheurles
Copy link

tdeheurles commented May 12, 2021

Hi,

I fail to send messages to a team with a restricted bot.

TL-DR:
I answer directly to my post, as I found my error. I hope it can help others as I didn't find the information in the documentation.

The issue was to use a channel definition and not a proper Conversation ID. You can find the conversation ID by using the keybase CLI:

 keybase chat conv-info teamname.subteam
ConversationName: teamname.subteamname#general
ConversationID: 000abcd...acb0251    # fake
ConvIDShort: 00...c452               # fake

whereas a channel definition is an object like this:

{
       name: teamname.subteamname,
       membersType: "team",
       topicType: "chat",
       topicName: "general",
       public: false
}

The valid code is:

const botpaperkey = "..."
await bot.init('botname', botPaperkey);
const team = "teamname.subteamname"
await bot.chat.send("000abcd...acb0251", { body: `Hello` });

To Keybase-bot team: maybe put a comment on what is exactly a ConversationID (as it's not present in the UI, we can think it's something like the name of the channel).


The issue I did have:

My understanding is a restricted bot can only read specific messages (the one defined by configuration) and is allowed to send messages to a team (standard or big team). I'm trying without success to send messages to my team with a restricted bot while I succeed in sending messages with a non-restricted bot.

const botpaperkey = "..."
await bot.init('botname', botPaperkey);
const team = "teamname.subteamname"
await bot.chat.send({
         name: team,
         membersType: "team",
         topicName: "general",
         topicType: "chat",
         public: false
}, {
   body: `Hello`,
});

membersType

I tried with and without the membersType. Without, I have a unknown user assertion.

Topic Name

I tried with and without this.
If I use general, it results in Restricted bots are unable to create conversations or decrypt channel names. Use an existing conversation via conversation ID.

Conversation ID

I tried different patterns for the conversation ID. team, team.subteam, team.subteam#general without success.
I also checked in the UI to find the conversation ID
--> this was my error, conversation ID can be found with the Keybase CLI

For reference
I did create my bot with:

keybase bot token create
keybase --standalone --home=/tmp/bot bot signup --username="${botname}"  --token="${token}"
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

1 participant