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(...);
}
}
}
}