poshbotio / PoshBot

Powershell-based bot framework
MIT License
536 stars 108 forks source link

Issue getting microsoft teams channel Id that command was issued in. #220

Closed dhlee90 closed 3 years ago

dhlee90 commented 3 years ago

Expected Behavior

When retrieving the channelId for the channel that the bot was called, I expect to see the channel id. It would be awesome if we could retrieve the Teams Channel Name that poshbot was called from.

Current Behavior

Calling $global:PoshBotContext.OriginalMessage.RawMessage.channelId returns channelId=msteams rather than the actual channel id.

Possible Solution

Is this possible? or is there another way we can grab the channel id or Name? Name would be preferable but id is fine.

Steps to Reproduce (for bugs)

1.This occurs when trying to get the channel id in the following line.

  1. $channel = $global:PoshBotContext.OriginalMessage.RawMessage.channelId

Context

We are trying to use the name/channel id in Teams to determine which webhook to pass as a parameter to a azure runbook

Your Environment

dhlee90 commented 3 years ago

the issue can be closed, I have found the channel id.. wasn't going deep enough. $channel = $global:PoshBotContext.OriginalMessage.RawMessage.channelData.teamsChannelId