diff --git a/bot.ps1 b/bot.ps1 index dd36eaf..46726b1 100755 --- a/bot.ps1 +++ b/bot.ps1 @@ -185,7 +185,7 @@ function Join-Pong { ) if($Ball) { - $padded_ball = $Ball+' ' + $padded_ball = '"{0}" ' -f $Ball } $body = '{0}: Pong! (ping {1}took {2} to arrive)' -f $SenderMxId,$padded_ball,$ReadableTimespan @@ -207,7 +207,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 = Compare-Timestamps -OriginServerTs $Event.origin_server_ts $readable_timespan = ConvertTo-HumanReadableTimespan -TimeSpan $difference