reddit-0.1.0.0: src/Reddit/Actions/Wiki.hs
-- | Contains subreddit wiki-related actions.
module Reddit.Actions.Wiki
( getWikiPage
, editWikiPage ) where
import Reddit.Routes.Run
import Reddit.Types.Empty
import Reddit.Types.Reddit
import Reddit.Types.Subreddit
import Reddit.Types.Wiki
import qualified Reddit.Routes as Route
import Control.Monad.IO.Class
import Data.Text (Text)
-- | Get the specified wiki page on a particular subreddit. Requires
-- permission to view the specified wiki page.
getWikiPage :: MonadIO m => SubredditName -> Text -> RedditT m WikiPage
getWikiPage sub page = runRoute $ Route.wikiPage sub page
-- | Edit the specified wiki page on a particular subreddit. Requires
-- permission to edit the specified wiki page.
editWikiPage :: MonadIO m
=> SubredditName -- ^ Subreddit whose wiki to modify
-> Text -- ^ The name of the page you're editing
-> Text -- ^ The new markdown content of the page you're editing
-> Text -- ^ The reason for the edit
-> RedditT m ()
editWikiPage sub page content reason = nothing $ runRoute $ Route.editPage sub page content reason