public/helper/Send-TwitterTyping_Indicator.ps1
function Send-TwitterTyping_Indicator { <# .SYNOPSIS Typing indicator and read receipts .DESCRIPTION POST direct_messages/indicate_typing Displays a visual typing indicator in the recipient’s Direct Message conversation view with the sender. Each request triggers a typing indicator animation with a duration of ~3 seconds. Usage A rudimentary approach would be to invoke an API request on every keypress or input event, however the application may quickly hit rate limits. A more sophisticated approach is to capture input events, but limit API requests to a specified interval based on the behavior of your users and the rate limit specified below. .PARAMETER recipient_id (required) .PARAMETER 204 .PARAMETER 400 .NOTES This helper function was generated by the information provided here: https://developer.twitter.com/en/docs/direct-messages/typing-indicator-and-read-receipts/api-reference/new-typing-indicator #> [CmdletBinding()] Param( [string]$recipient_id, [string]$204, [string]$400 ) Begin { [string]$Method = 'POST' [string]$Resource = '/direct_messages/indicate_typing' [string]$ResourceUrl = 'https://api.twitter.com/1.1/direct_messages/indicate_typing.json' [hashtable]$Parameters = $PSBoundParameters $CmdletBindingParameters | ForEach-Object { $Parameters.Remove($_) } } Process { If (-Not $OAuthSettings) { $OAuthSettings = Get-TwitterOAuthSettings -Resource $Resource } Invoke-TwitterAPI -Method $Method -ResourceUrl $ResourceUrl -Resource $Resource -Parameters $Parameters -OAuthSettings $OAuthSettings } End { } } |