Skip to content
Snippets Groups Projects
Verified Commit 1bebf89a authored by Alexander Olofsson's avatar Alexander Olofsson
Browse files

Ignore any non m.text messages in bot example

parent 31544f80
No related branches found
No related tags found
No related merge requests found
Pipeline #11503 passed
......@@ -47,6 +47,8 @@ class MatrixBot
end
def on_message(message)
return unless message.content[:msgtype] == 'm.text'
msgstr = message.content[:body]
return unless msgstr =~ /^!(ping|echo)\s*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment