MCPcopy
hub / github.com/praw-dev/praw / mark_unread

Method mark_unread

praw/models/inbox.py:131–156  ·  view source on GitHub ↗

Unmark Comments or Messages as read. :param items: A list containing instances of :class:`.Comment` and/or :class:`.Message` to be marked as unread relative to the authorized user's inbox. Requests are batched at 25 items (Reddit limit). For example

(self, items: list[models.Comment | models.Message])

Source from the content-addressed store, hash-verified

129 items = items[25:]
130
131 def mark_unread(self, items: list[models.Comment | models.Message]) -> None:
132 """Unmark Comments or Messages as read.
133
134 :param items: A list containing instances of :class:`.Comment` and/or
135 :class:`.Message` to be marked as unread relative to the authorized user's
136 inbox.
137
138 Requests are batched at 25 items (Reddit limit).
139
140 For example, to mark the first 10 items as unread try:
141
142 .. code-block:: python
143
144 to_unread = list(reddit.inbox.all(limit=10))
145 reddit.inbox.mark_unread(to_unread)
146
147 .. seealso::
148
149 - :meth:`.Comment.mark_unread`
150 - :meth:`.Message.mark_unread`
151
152 """
153 while items:
154 data = {"id": ",".join(x.fullname for x in items[:25])}
155 self._reddit.post(API_PATH["unread_message"], data=data)
156 items = items[25:]
157
158 def mentions(self, **generator_kwargs: Any) -> Iterator[models.Comment]:
159 r"""Return a :class:`.ListingGenerator` for mentions.

Callers 4

test_mark_all_readMethod · 0.45
test_mark_unreadMethod · 0.45
test_mark_unreadMethod · 0.45
test_mark_unreadMethod · 0.45

Calls 1

postMethod · 0.80

Tested by 4

test_mark_all_readMethod · 0.36
test_mark_unreadMethod · 0.36
test_mark_unreadMethod · 0.36
test_mark_unreadMethod · 0.36