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

Method create

praw/models/mod_notes.py:94–190  ·  view source on GitHub ↗

Create a :class:`.ModNote` for a redditor in the specified subreddit. :param label: The label for the note. As of this writing, this can be one of the following: ``"ABUSE_WARNING"``, ``"BAN"``, ``"BOT_BAN"``, ``"HELPFUL_USER"``, ``"PERMA_BAN"``, ``"SOLID_CONTRIBUTOR"

(
        self,
        *,
        label: str | None = None,
        note: str,
        redditor: Redditor | str | None = None,
        subreddit: Subreddit | str | None = None,
        thing: Comment | Submission | str | None = None,
        **other_settings: Any,
    )

Source from the content-addressed store, hash-verified

92 yield from self._bulk_generator(redditors, subreddits)
93
94 def create(
95 self,
96 *,
97 label: str | None = None,
98 note: str,
99 redditor: Redditor | str | None = None,
100 subreddit: Subreddit | str | None = None,
101 thing: Comment | Submission | str | None = None,
102 **other_settings: Any,
103 ) -> models.ModNote:
104 """Create a :class:`.ModNote` for a redditor in the specified subreddit.
105
106 :param label: The label for the note. As of this writing, this can be one of the
107 following: ``"ABUSE_WARNING"``, ``"BAN"``, ``"BOT_BAN"``,
108 ``"HELPFUL_USER"``, ``"PERMA_BAN"``, ``"SOLID_CONTRIBUTOR"``,
109 ``"SPAM_WARNING"``, ``"SPAM_WATCH"``, or ``None`` (default: ``None``).
110 :param note: The content of the note. As of this writing, this is limited to 250
111 characters.
112 :param redditor: The redditor to create the note for (default: ``None``).
113
114 .. note::
115
116 This parameter is required if ``thing`` is not provided or this is not
117 called from a :class:`.Redditor` instance (e.g.,
118 ``reddit.redditor.notes``).
119
120 :param subreddit: The subreddit associated with the note (default: ``None``).
121
122 .. note::
123
124 This parameter is required if ``thing`` is not provided or this is not
125 called from a :class:`.Subreddit` instance (e.g.,
126 ``reddit.subreddit.mod``).
127
128 :param thing: Either the fullname of a comment/submission, a :class:`.Comment`,
129 or a :class:`.Submission` to associate with the note.
130 :param other_settings: Additional keyword arguments can be provided to handle
131 new parameters as Reddit introduces them.
132
133 :returns: The new :class:`.ModNote` object.
134
135 For example, to create a note for u/spez in r/test:
136
137 .. code-block:: python
138
139 reddit.subreddit("test").mod.notes.create(
140 label="HELPFUL_USER", note="Test note", redditor="spez"
141 )
142 # or
143 reddit.redditor("spez").mod.notes.create(
144 label="HELPFUL_USER", note="Test note", subreddit="test"
145 )
146 # or
147 reddit.notes.create(
148 label="HELPFUL_USER", note="Test note", redditor="spez", subreddit="test"
149 )
150
151 """

Callers

nothing calls this directly

Calls 4

_ensure_attributeMethod · 0.95
postMethod · 0.80
infoMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected