Giter VIP home page Giter VIP logo

Comments (1)

techthoughts2 avatar techthoughts2 commented on June 11, 2024

Parameters Change

In many functions parameters such as DisableNotification have been set to bool. It would be more interesting and standardized if they were set to Switch.

Determine boolean parameters that could potentially be changed to Switch

$results = @()
$functions = Get-Command -Module PoshGram
foreach ($f in $functions.Name) {
    $paramSets = Get-Command $f | Select-Object -Expand ParameterSets
    $obj = New-Object System.Object
    $obj | Add-Member -type NoteProperty -Name Function -Value $f
    $params = @()
    foreach ($item in $paramSets.Parameters) {
        if ($item.ParameterType.Name -eq 'Boolean') {
            $params += $item.Name        
        }
    }
    $obj | Add-Member -type NoteProperty -Name BooleanParams -Value $params
    $results += $obj
}
$results
Function                    BooleanParams
--------                    -------------
Send-TelegramLocalAnimation {DisableNotification}
Send-TelegramLocalAudio     {DisableNotification}
Send-TelegramLocalDocument  {DisableNotification}
Send-TelegramLocalPhoto     {DisableNotification}
Send-TelegramLocalVideo     {Streaming, DisableNotification}
Send-TelegramLocation       {DisableNotification}
Send-TelegramMediaGroup     {DisableNotification}
Send-TelegramTextMessage    {Preview, DisableNotification}
Send-TelegramURLAnimation   {DisableNotification}
Send-TelegramURLAudio       {DisableNotification}
Send-TelegramURLDocument    {DisableNotification}
Send-TelegramURLPhoto       {DisableNotification}
Send-TelegramURLVideo       {Streaming, DisableNotification}
Test-BotToken               {}

Thoughts on change

This will be a potentially breaking change for some. I do like the suggestion though and agree that these are better suited as Switch.

I will work on integrating this.

from poshgram.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.