Skip to content

Commit

Permalink
Add missing type annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
LilSpazJoekp committed Nov 28, 2022
1 parent 239ce85 commit bb8c7a7
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions asyncpraw/models/reddit/mixins/replyable.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""Provide the ReplyableMixin class."""
from typing import TYPE_CHECKING, Optional
from typing import TYPE_CHECKING, Optional, Union

from ....const import API_PATH

Expand All @@ -10,13 +10,15 @@
class ReplyableMixin:
"""Interface for :class:`.RedditBase` classes that can be replied to."""

async def reply(self, body: str) -> Optional["asyncpraw.models.Comment"]:
async def reply(
self, body: str
) -> Optional[Union["asyncpraw.models.Comment", "asyncpraw.models.Message"]]:
"""Reply to the object.
:param body: The Markdown formatted content for a comment.
:returns: A :class:`.Comment` object for the newly created comment or ``None``
if Reddit doesn't provide one.
:returns: A :class:`.Comment` or :class:`.Message` object for the newly created
comment or message or ``None`` if Reddit doesn't provide one.
:raises: ``asyncprawcore.exceptions.Forbidden`` when attempting to reply to some
items, such as locked submissions/comments or non-replyable messages.
Expand Down

0 comments on commit bb8c7a7

Please sign in to comment.