Source code for redditwarp.models.comment_SYNC
from __future__ import annotations
from typing import TYPE_CHECKING, Mapping, Any, Optional
if TYPE_CHECKING:
from ..client_SYNC import Client
from .comment import (
Comment as BaseComment,
LooseComment as BaseLooseComment,
)
[docs]class Comment(BaseComment):
def __init__(self, d: Mapping[str, Any], client: Client) -> None:
super().__init__(d)
self.client: Client = client
("")
[docs] def edit_body(self, text: str) -> Comment:
return self.client.p.comment.edit_body(self.id, text)
[docs] def distinguish_and_sticky(self) -> Comment:
return self.client.p.comment.distinguish_and_sticky(self.id)
[docs] def apply_removal_reason(self,
reason_id: Optional[str],
note: Optional[str] = None) -> None:
self.client.p.comment.apply_removal_reason(self.id, reason_id, note)
[docs] def send_removal_comment(self,
title: str,
message: str) -> Comment:
return self.client.p.comment.send_removal_comment(self.id, title, message)
[docs] def send_removal_message(self,
title: str,
message: str,
*,
exposed: bool = False) -> None:
self.client.p.comment.send_removal_message(self.id, title, message, exposed=exposed)