poshbotio / PoshBot

Powershell-based bot framework
MIT License
537 stars 108 forks source link

When adding a channel rule the default does not get removed #131

Closed DWOF closed 5 years ago

DWOF commented 5 years ago

Expected Behavior

When setting the channel rules in the configuration it should replace the default rule that allows all commands in all channels

Current Behavior

When setting the channel rules in the configuration it merges with the default rule that allows all commands in all channels

Steps to Reproduce (for bugs)

$botParams = @{
BackendConfiguration = @{
        Name = 'SlackBackend'
        Token = 'XXXX'
    }
ChannelRules = @(
        @{
            Channel = 'bottestingfactory'
            IncludeCommands = @('*')
            ExcludeCommands = @()
          }
  )
}

$myBotConfig = New-PoshBotConfiguration @botParams

$myBotConfig.ChannelRules

Context

Unable to limit commands in slack channels

Your Environment

devblackops commented 5 years ago

Thanks @DWOF! Fix merged in.