Closed ThePoShWolf closed 5 years ago
Also switching the CommandPrefix to '!' completely resolves the issue.
The mention that "some command" -match "." would always evaluate to true. I think the solution there is to wrap that in a [regex]::escape()
and it should handle using . or * or other regex characters as the bot command character.
From: Anthony Howell notifications@github.com Sent: Wednesday, October 10, 2018 11:44:34 PM To: poshbotio/PoshBot Cc: Subscribed Subject: Re: [poshbotio/PoshBot] CommandPrefix = '.' causes bot to respond to all messages (#124)
Also switching the CommandPrefix to '!' completely resolves the issue.
ā You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/poshbotio/PoshBot/issues/124#issuecomment-428758498, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AQDqFqakTC66di1S-icUHJGD7PSAeiQEks5ujnhSgaJpZM4XWd2e.
Thanks for catching this @ThePoShWolf! Thanks for the suggestion @ChrisLGardner! Thanks for fixing it @Windos! š š š
Oh yeah, just me being lazy and not wanting to reach all the way for the !
.
When CommandPrefix is set to '.', it causes the bot to respond to all messages with:
Commands prefixed with a period still work though.
Expected Behavior
What should happen is the bot should not respond to any messages except for commands prefixed with a period.
Current Behavior
Currently when CommandPrefix is set to '.' the bot responds to all messages with:
Possible Solution
No idea. You mentioned you think that some where
Is evaluating to $true.
Steps to Reproduce (for bugs)
Here's my bot config:
Context
I was simply trying to use a period as the command prefix. Less of a stretch than an exclamation point.
Your Environment