poshbotio / PoshBot

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

PoshBot crashes whenever a command is run #86

Closed akuehner closed 5 years ago

akuehner commented 6 years ago

Expected Behavior

Fresh install of PoshBot, brand new config using guides in the repo. After running $bot.Start() bot should start and keep running while commands are sent from Slack.

Current Behavior

Bot stops whenever any text is sent to Slack channel - doesn't even attempt to run the command. I then tried this fix:

SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]

# Install PoshBot and create new PoshBot configuration and store it for later use
    Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
    Install-Module -Name PoshBot -Repository PSGallery -Force
    $ErrorActionPreference = 'Ignore'
    Import-Module -Name PoshBot -ErrorAction SilentlyContinue
    $ErrorActionPreference = 'Stop'

Bot no longer crashes on any text being sent in Slack, but the bot will stop after any 1 successful command is sent. For example; I can say "hi" in Slack, and the Bot sees it and continues on, but if I send "!help" it'll process that command, output the results, then stop. Before running the above "fix" it didn't even get that for. It stopped for everything without processing any results.

Steps to Reproduce (for bugs)

  1. Install PoshBot
  2. Create Config File
  3. Start PoshBot
  4. Send any text through Slack channel

Your Environment

Name                           Value
----                           -----
PSVersion                      5.1.14393.2312
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.14393.2312
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Script     1.0.0      pb.RestartService                   Restart-Service
Script     0.10.2     PoshBot                             {Get-PoshBot, Get-PoshBotConfiguration, Get-PoshBotStatefulData, New-PoshBotAce...}
Script     0.1.0      PSSlack                             {Find-SlackMessage, Get-PSSlackConfig, Get-SlackAuth, Get-SlackChannel...}

I have tried this on multiple systems now though

devblackops commented 6 years ago

Thanks for the report @akuehner. I'll try to repro on my end.

akuehner commented 6 years ago

Hey @devblackops - find anything and/or anything else I can do to assist in this?

devblackops commented 6 years ago

@akuehner Do you have some logs you can share?

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.