0
for (const target of await bot.notification.installations()) {
  if (target.type === NotificationTargetType.Group) {
    // How can I get the group I want to send messages ?
    await target.sendAdaptiveCard(...);
  }
}

I can get all the groups installed by the teams app, but it is difficult for to choose the group I want to send messages.

For example, If I want to choose a channel, I can use channel id or channel name to choose a channel.

for (const target of await bot.notification.installations()) {
  if (target.type === NotificationTargetType.Channel) {
    const channels = await target.channels();
    for (const channel of channels) {
      // choose a channel by channel id
      if (channel.info.id === 'xxxx') {
      await channel.sendAdaptiveCard(...);
      }
      // choose a channel by channel name
      if (channel.info.name === 'xxxx') {
      await channel.sendAdaptiveCard(...);
      }
    }
  }
}

1 Answers1

0

The Bot Framework SDK is utilized inside the TeamsFx SDK to access information about Teams' teams, channels, and members. However, there is currently no available API to retrieve information about group chats.

Another issue is created in botbuilder-js repo to track this support: https://github.com/microsoft/botbuilder-js/issues/4441

You may also follow the latest update on the similar issue in TeamsFx GitHub repo: https://github.com/OfficeDev/TeamsFx/issues/8015

qinezh
  • 1
  • 1