From 94179601b7e22f32844a112338eaa311b538d412 Mon Sep 17 00:00:00 2001 From: lub Date: Tue, 7 Jan 2020 22:29:42 +0100 Subject: [PATCH] fix regex to react only on !ping or !ping --- bot.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot.ps1 b/bot.ps1 index ce585b1..329bf4c 100755 --- a/bot.ps1 +++ b/bot.ps1 @@ -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( (?.*))?') { + if($Event.content.msgtype -eq 'm.text' -and $Event.content.body -match '^!ping($| (?.*))') { $difference = Measure-TimeDifference -OriginTime $origin_time $readable_timespan = ConvertTo-HumanReadableTimespan -TimeSpan $difference