poshbotio / PoshBot

Powershell-based bot framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

dhlee90 opened this issue · comments

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.
2. $channel = $global:PoshBotContext.OriginalMessage.RawMessage.channelId
3.
4.

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

  • Module version used: 0.13.0
  • Operating System and PowerShell version: windows server 2019, powershell 5.1.17763.1007

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