Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to define ChannelRules in Microsoft Teams channels? #223

Open
drenand opened this issue Oct 15, 2020 · 3 comments
Open

How to define ChannelRules in Microsoft Teams channels? #223

drenand opened this issue Oct 15, 2020 · 3 comments

Comments

@drenand
Copy link

drenand commented Oct 15, 2020

Good morning.
I would appreciate some help setting up Channel Rules for Microsoft Teams channels.

Thank you very much for any help offered!

Expected Behavior

I want to be able to configure Channel Rules for Poshbot on a Microsoft Teams backend.

Current Behavior

The documentation only shows how to configure channel rules for Slack, but contains no examples for Microsoft Teams.

Specifically, in the "Channel" field on the ChannelRules hashtable, what should I put in this field when using Microsoft Teams?
For Slack the example is pretty straightforward (example: 'general'), but for Teams this doesn't seem to be enough.

On my Teams, my channel is called 'General', and is under a team called 'DevOps'.

In this "Channel" field, under ChannelRules, I have tried, with no success:

  • The ID you get when clicking "get link to channel" (just the decoded string ending in "...thread.skype")
  • The ID you get when clicking "get link to channel" (the full string)
  • The ID you get when clicking "get link to team" (just the decoded string ending in "...thread.skype")
  • The ID you get when clicking "get link to team" (the full string)
  • The Sharepoint object ID of this General channel
  • All possible variations of "DevOps.General", "DevOps_General", "DevOps>General", "General", "DevOps"...

If I have ChannelRules enabled and issue a command such as !about, every single time I get this response from PoshBot:
"Sorry :( PoshBot has been configured to not allow that command in this channel".
If I remove the ChannelRules, the commands run fine, so the remaining configurations seem to be properly done.

Possible Solution

I have no idea what else I should be doing, maybe it's just not possible to issue ChannelRules on Microsoft Teams?

Steps to Reproduce (for bugs)

  1. Setup Poshbot with Microsoft Teams backend.
  2. Test issuing commands on a channel, confirm that PoshBot is working.
  3. Try setting up ChannelRules for that channel, PoshBot will refuse to answer every single time because the "Channel" field is not filled correctly.

Context

I am deploying a Teams Bot to allow users to run some select powershell commands, in order to simplify some work from the DevOps team.

Your Environment

Windows 10 laptop (localhost)
Microsoft Teams (cloud version)
PoshBot v0.13.0
Powershell v5.1.18362.752

Thank you!

@dreznicek
Copy link
Contributor

Hey, just checking on this. We are needing to do this as well. Is this a slack only feature?

@drenand
Copy link
Author

drenand commented Jan 7, 2021

Hey, just checking on this. We are needing to do this as well. Is this a slack only feature?

Hi.

I had to forget about this feature as I was not able to get it working, found no documentation on the issue, and got no replies.

I only used a tight control on the permissions engine, and "disciplined" the users to call all bot interactions on a dedicated channel, or through DM.

Still, if you find a solution, please let me know. Cheers!

@dreznicek
Copy link
Contributor

Yeah, I'm currently working on a middleware solution on PreReceive where specific commands can only be executed on specific channels, which is exposed in $Context.Message.ToName. I can go more granular by also incorporating $Context.Message.FromName. So far, preliminary tests are working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants