MCPcopy Index your code
hub / github.com/praw-dev/praw / delete

Method delete

praw/models/mod_notes.py:192–280  ·  view source on GitHub ↗

Delete note(s) for a redditor. :param delete_all: When ``True``, delete all notes for the specified redditor in the specified subreddit (default: ``False``). .. note:: This will make a request for each note. :param note_id: The ID of the no

(
        self,
        *,
        delete_all: bool = False,
        note_id: str | None = None,
        redditor: Redditor | str | None = None,
        subreddit: Subreddit | str | None = None,
    )

Source from the content-addressed store, hash-verified

190 return self._reddit.post(API_PATH["mod_notes"], data=data)
191
192 def delete(
193 self,
194 *,
195 delete_all: bool = False,
196 note_id: str | None = None,
197 redditor: Redditor | str | None = None,
198 subreddit: Subreddit | str | None = None,
199 ) -> None:
200 """Delete note(s) for a redditor.
201
202 :param delete_all: When ``True``, delete all notes for the specified redditor in
203 the specified subreddit (default: ``False``).
204
205 .. note::
206
207 This will make a request for each note.
208
209 :param note_id: The ID of the note to delete. This parameter is ignored if
210 ``delete_all`` is ``True``.
211 :param redditor: The redditor to delete the note(s) for (default: ``None``). Can
212 be a :class:`.Redditor` instance or a redditor name.
213
214 .. note::
215
216 This parameter is required if this method is **not** called from a
217 :class:`.Redditor` instance (e.g., ``redditor.notes``).
218
219 :param subreddit: The subreddit to delete the note(s) from (default: ``None``).
220 Can be a :class:`.Subreddit` instance or a subreddit name.
221
222 .. note::
223
224 This parameter is required if this method is **not** called from a
225 :class:`.Subreddit` instance (e.g., ``reddit.subreddit.mod``).
226
227
228 For example, to delete a note with the ID
229 ``"ModNote_d324b280-5ecc-435d-8159-3e259e84e339"``, try:
230
231 .. code-block:: python
232
233 reddit.subreddit("test").mod.notes.delete(
234 note_id="ModNote_d324b280-5ecc-435d-8159-3e259e84e339", redditor="spez"
235 )
236 # or
237 reddit.redditor("spez").notes.delete(
238 note_id="ModNote_d324b280-5ecc-435d-8159-3e259e84e339", subreddit="test"
239 )
240 # or
241 reddit.notes.delete(
242 note_id="ModNote_d324b280-5ecc-435d-8159-3e259e84e339",
243 subreddit="test",
244 redditor="spez",
245 )
246
247 To delete all notes for u/spez, try:
248
249 .. code-block:: python

Callers

nothing calls this directly

Calls 2

_ensure_attributeMethod · 0.95
_notesMethod · 0.95

Tested by

no test coverage detected