diff options
author | Teddy Wing | 2017-08-02 01:59:47 +0200 |
---|---|---|
committer | Teddy Wing | 2017-08-02 01:59:47 +0200 |
commit | a6007bffdbbeb8391b2b8991377857c475308e83 (patch) | |
tree | df466b12a14f61b44344355fb515fe06f3863716 /src | |
parent | 04a9fc75e23f2903d8df07e3cd20e7dba64959b1 (diff) | |
download | sorbot-a6007bffdbbeb8391b2b8991377857c475308e83.tar.bz2 |
GitHubCommit.hs: Add `ChannelRepoUrl` database type
A type that will be used in conjunction with 'sqlite-simple' to read
values from the plugin's database table.
Diffstat (limited to 'src')
-rw-r--r-- | src/Plugin/GitHubCommit.hs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Plugin/GitHubCommit.hs b/src/Plugin/GitHubCommit.hs index 8fa8d0a..e5af381 100644 --- a/src/Plugin/GitHubCommit.hs +++ b/src/Plugin/GitHubCommit.hs @@ -15,3 +15,9 @@ gitHubCommit = Plugin gitHubCommitAction :: PluginAction gitHubCommitAction message = "https://github.com/" ++ M.text message =~ matchRegex gitHubCommit + +-- | A type to match the database table for this plugin. +data ChannelRepoUrl = ChannelRepoUrl Int String String deriving (Show) + +instance FromRow ChannelRepoUrl where + fromRow = ChannelRepoUrl <$> field <*> field <*> field |