Module pyreddit.models.post
Module for Post class.
Classes
class Post (subreddit: str, permalink: str, title: str, text: str, media: Union[Media, NoneType] = None)
-
Represents a Reddit post.
Parameters
subreddit
:str
- Subreddit within which the post was created (or crossposted).
permalink
:str
- Reddit permalink of the post.
title
:str
- Title of the post.
text
:str
- Description of the post.
media
:Media
-
(Default value = None)
Media associated with the post (if present), None otherwise. This determines the post type.
Methods
-
Get footer of the post.
This includes a link to the subreddit and a link to the post.
def get_msg(self) ‑> str
-
Get the full message of the post.
This includes post title, description and footer.
def get_type(self) ‑> ContentType
-
Return the post type: this is determined by the media type, if present.