keybase/keybase-bot

quick question on sending messages

bitcoiners opened this issue · 5 comments

Hello,
I am working on a chat bot and want to send a message to a team channel. Not sure how

Instructions have:

const channel = {name: 'kbot,' + bot.myInfo().username, public: false, topicType: 'chat'}

How do I send a message to
team "x", channel "y" within team "x"?

Thanks.

"Topic name" is the channel. Single channel teams and other kinds of conversations only have a single "general" topic. Therefore in order to send a message to channel y in team x, you need to use the following ChatChannel object:

{
  name: "x",
  topicName: "y"
}

Thank you.
Still having a bit of trouble. I am logged in as user "cryptomooner", trying to send a message to team "eosdetroit", channel "alerts". Tried with this setting.

const channel = {name: 'eosdetroit', topicName: 'alerts', topicType: 'chat' }

Getting an error:
Your bot is initialized. It is logged in as cryptomooner
Error: In resolving 'eosdetroit': unknown user assertion

Sorry this isn't clearer. You're missing one more parameter which is optional with users but necessary with teams.

Try:

const channel = {name: 'eosdetroit', topicName: 'alerts', topicType: 'chat', membersType: 'team'}

Thank you.
Tried with your recommended settings.
Got new error:
..
Your bot is initialized. It is logged in as cryptomooner
Error: 2019-09-03T07:17:45.996815+07:00 ▶ [ERRO keybase main.go:460] 001 interrupted

It worked on second try! Thanks.