aboutsummaryrefslogtreecommitdiffstats
path: root/src/Plugin.hs
diff options
context:
space:
mode:
authorTeddy Wing2017-08-17 00:46:35 +0200
committerTeddy Wing2017-08-17 00:46:35 +0200
commit40f8f12e6a749ebd5c87df5675bf4b7c2118ccef (patch)
tree02d5f6deb9a22faf4d145b2d6df841a01e0b51a4 /src/Plugin.hs
parentf4028e21f8a138961927b8e794b349f209b00dc7 (diff)
downloadsorbot-40f8f12e6a749ebd5c87df5675bf4b7c2118ccef.tar.bz2
Message: Add a function to get the `text` field as a string
Clean up some of the calls to get the `text` field by adding a function that abstracts the call to `Data.Text(unpack)`.
Diffstat (limited to 'src/Plugin.hs')
-rw-r--r--src/Plugin.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Plugin.hs b/src/Plugin.hs
index 26432d9..0ff1367 100644
--- a/src/Plugin.hs
+++ b/src/Plugin.hs
@@ -22,7 +22,7 @@ matchPlugin message = firstPlugin $ matchPlugins message plugins
-- | Filter the list of plugins to those that match the given message.
matchPlugins :: M.Message -> [Plugin] -> [Plugin]
matchPlugins message plugins =
- [p | p <- plugins, (T.unpack $ M.text message) =~ matchRegex p]
+ [p | p <- plugins, M.textStr message =~ matchRegex p]
-- | Run the action belonging to the plugin, stored in its `perform` field.
performPlugin :: Plugin -> PluginAction