Closed ChrisLGardner closed 6 years ago
Made a quick fix to tidy up the casing on _bot and add .Name since I'd missed it from one of the Invoke calls.
@ChrisLGardner I think this should be $this._Bot.Backend.GetType().Name
so it returns the actual class type instead of the arbitrary Name
that you can set on the backend. That way, it will be consistent for people who want to use it from the SlackBackend
or TeamsBackend
backend classes.
Awesome. Thanks!
Description
Some systems like Teams will not automatically expand some output, like image links so sending them markdown instead of a plain link will correct this to enable this behaviour we need to be able to let other plugins know which backend it is talking to. Using $Global:PoshbotContext.BackendType will enable this.
I used the name of the backend as I didn't want to pass the whole Backend in when it wasn't really needed.
Related Issue
104
How Has This Been Tested?
Tested with the xkcd plugin and using this code. Built locally and tested with Teams. I don't have a slack workspace to test it with but I can't see why it won't work. I'll submit a PR to PoshBot.xkcd as well with this fix.
Types of changes
Checklist: