fix regex to react only on !ping or !ping <msg>

master
lub 5 years ago
parent 2da74c6841
commit 94179601b7

@ -234,7 +234,7 @@ function Open-JoinEvent {
}
#the "ball" is a string returned by the bot
if($Event.content.msgtype -eq 'm.text' -and $Event.content.body -match '^!ping( (?<ball>.*))?') {
if($Event.content.msgtype -eq 'm.text' -and $Event.content.body -match '^!ping($| (?<ball>.*))') {
$difference = Measure-TimeDifference -OriginTime $origin_time
$readable_timespan = ConvertTo-HumanReadableTimespan -TimeSpan $difference

Loading…
Cancel
Save