Get wiki page, get wiki page discussions

Signed-off-by: Vartan Benohanian <vartanbeno@gmail.com>
This commit is contained in:
Vartan Benohanian
2020-09-04 23:42:24 -04:00
parent 9d5132f15c
commit a9e42b21b1
5 changed files with 499 additions and 8 deletions
+8
View File
@@ -19,6 +19,7 @@ const (
kindMore = "more"
kindModAction = "modaction"
kindMulti = "LabeledMulti"
kindWikiPage = "wikipage"
kindWikiPageListing = "wikipagelisting"
kindWikiPageSettings = "wikipagesettings"
)
@@ -96,6 +97,8 @@ func (t *thing) UnmarshalJSON(b []byte) error {
v = new(trophyList)
case kindKarmaList:
v = new([]*SubredditKarma)
case kindWikiPage:
v = new(WikiPage)
case kindWikiPageListing:
v = new([]string)
case kindWikiPageSettings:
@@ -174,6 +177,11 @@ func (t *thing) Karma() ([]*SubredditKarma, bool) {
return *v, ok
}
func (t *thing) WikiPage() (v *WikiPage, ok bool) {
v, ok = t.Data.(*WikiPage)
return
}
func (t *thing) WikiPages() ([]string, bool) {
v, ok := t.Data.(*[]string)
if !ok {