How to use the apraw.models.mixins.subreddit.SubredditMixin function in aPRAW

To help you get started, we’ve selected a few aPRAW examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Dan6erbond / aPRAW / apraw / models / reddit / message.py View on Github external
from typing import Dict, Any, TYPE_CHECKING

from ..helpers.apraw_base import aPRAWBase
from ..mixins.author import AuthorMixin
from ..mixins.replyable import ReplyableMixin
from ..mixins.subreddit import SubredditMixin

if TYPE_CHECKING:
    from ...reddit import Reddit


class Message(aPRAWBase, SubredditMixin, AuthorMixin, ReplyableMixin):

    def __init__(self, reddit: 'Reddit', data: Dict[str, Any]):
        super().__init__(reddit, data, reddit.message_kind)
        AuthorMixin.__init__(self)
        SubredditMixin.__init__(self)
github Dan6erbond / aPRAW / apraw / models / reddit / submission.py View on Github external
from ...reddit import Reddit


class SubmissionKind(Enum):
    """
    An enum representing the valid submission kinds
    """
    LINK = "link"
    SELF = "self"
    IMAGE = "image"
    VIDEO = "video"
    VIDEOGIF = "videogif"


class Submission(aPRAWBase, DeletableMixin, HideableMixin, ReplyableMixin, NSFWableMixin, SavableMixin, VotableMixin,
                 AuthorMixin, SubredditMixin, SpoilerableMixin):
    """
    The model representing submissions.

    Members
    -------
    reddit: Reddit
        The :class:`~apraw.Reddit` instance with which requests are made.
    data: Dict
        The data obtained from the /about endpoint.
    mod: SubmissionModeration
        The :class:`~apraw.models.SubmissionModeration` instance to aid in moderating the submission.
    kind: str
        The item's kind / type.

    **Typical Attributes**
github Dan6erbond / aPRAW / apraw / models / reddit / comment.py View on Github external
from ..mixins.savable import SavableMixin
from ..mixins.subreddit import SubredditMixin
from ..mixins.votable import VotableMixin
from ..subreddit.subreddit import Subreddit
from ...const import API_PATH
from ...utils import prepend_kind, snake_case_keys, ExponentialCounter

if TYPE_CHECKING:
    from ...reddit import Reddit
    from .submission import Submission
    from ..helpers.comment_forrest import CommentForrest


@all_reactive(not_type=(aPRAWBase, datetime, PostModeration))
class Comment(aPRAWBase, DeletableMixin, HideableMixin, ReplyableMixin, SavableMixin, VotableMixin, AuthorMixin,
              SubredditMixin, ReactiveOwner):
    """
    The model representing comments.

    Members
    -------
    mod: CommentModeration
        The :class:`~apraw.models.CommentModeration` instance to aid in moderating the comment.
    kind: str
        The item's kind / type.
    url: str
        The URL pointing to this comment.

    **Typical Attributes**

    This table describes attributes that typically belong to objects of this
    class. Attributes are dynamically provided by the :class:`~apraw.models.aPRAWBase` class