-
-
Notifications
You must be signed in to change notification settings - Fork 107
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
add CustomData param to New-PoshBotCardResponse #89
add CustomData param to New-PoshBotCardResponse #89
Conversation
This is to allow custom data to be passed back to SendMessage in the Data stream of the response. Backend developers can leverage this to receive parsable data (i.e. REST body JSON) specific to their card response options. This will also be ignored by the included backends (Slack and Teams), so plugins/backends using this can create functions that will be cross-backend compatible.
) | ||
|
||
$response = [ordered]@{ | ||
PSTypeName = 'PoshBot.Card.Response' | ||
Type = $Type | ||
Text = $Text.Trim() | ||
Private = $PSBoundParameters.ContainsKey('Private') | ||
DM = $PSBoundParameters.ContainsKey('DM') | ||
DM = $PSBoundParameters['DM'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was changed to allow the DM
switch to work as expected if someone passed it as -DM:$false
. Currently, DM will always equal true if the parameter is present in PSBoundParameters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
[string]$Color = '#D3D3D3' | ||
[string]$Color = '#D3D3D3', | ||
|
||
[object]$CustomData | ||
) | ||
|
||
$response = [ordered]@{ | ||
PSTypeName = 'PoshBot.Card.Response' | ||
Type = $Type | ||
Text = $Text.Trim() | ||
Private = $PSBoundParameters.ContainsKey('Private') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is Private
just here as a reservation or can it be removed as well? The current parameters don't apparently have Private
included.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oooh. That's some old, dead code right there. I'll remove it. Thanks for catching that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For sure!
Thanks for this! |
Cheers! |
Description
This is to allow custom data to be passed back to SendMessage in the Data stream of the response. Backend developers can leverage this to receive parsable data (i.e. REST body JSON) specific to their card response options. This will also be ignored by the included backends (Slack and Teams), so plugins/backends using this can create functions that will be cross-backend compatible.
Related Issue
#88
Motivation and Context
This is to allow custom data to be passed back to SendMessage in the Data stream of the response and be parsed by custom backends.
How Has This Been Tested?
This has been tested during the buildout of the Google Chat backend I'm adding to PSGSuite currently. PSGSuite itself is tested in PS 5-Core via AppVeyor and Travis CI.
Screenshots:
Types of changes
Checklist: