aboutsummaryrefslogtreecommitdiffstats
path: root/src/Message.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/Message.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/Message.hs')
-rw-r--r--src/Message.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Message.hs b/src/Message.hs
index db582e9..a0cadc3 100644
--- a/src/Message.hs
+++ b/src/Message.hs
@@ -2,6 +2,8 @@ module Message
( Message(..)
, Channel
, Nick
+
+ , textStr
) where
import qualified Data.Text as T
@@ -15,3 +17,6 @@ data Message = Message
, channel :: Channel
, nick :: Nick
}
+
+textStr :: Message -> String
+textStr = T.unpack . text