Skip to content

misspy.notes

misspy.notes.notes

misskey notes class.

Source code in misspy/notes.py
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
class notes:
    """misskey notes class.

    """

    def __init__(self, address, i, ssl=True) -> None:
        self.i = i
        self.address = address
        self.ssl = ssl

    async def note(
        self,
        local: bool = False,
        reply: bool = None,
        renote: bool = None,
        withFiles: bool = None,
        poll: bool = None,
        limit: int = 10,
        sinceId: str = None,
        untilId: str = None,
    ):
        """Retrieves the list of notes.

        Args:
            local (bool, optional): Only locally created notes are retrieved. Defaults to False.
            reply (bool, optional): If `true`, only replies are retrieved; if `false`, non-replies are retrieved. If no value is set, notes are retrieved regardless of whether they are replies or not. Defaults to None.
            renote (bool, optional): If `true`, only renotes are retrieved; if `false`, non-renotes are retrieved. If no value is set, notes are retrieved regardless of whether they are replies or not. Defaults to None.
            withFiles (bool, optional): If `true`, only notes with attachments will be retrieved; if `false`, only notes without attachments will be retrieved. If no value is set, notes are retrieved with or without attachments. Defaults to None.
            poll (bool, optional): If `true`, only notes with votes will be retrieved; if `false`, only notes without votes will be retrieved. If no value is set, notes are retrieved with or without votes. Defaults to None.
            limit (int, optional): Specifies the maximum number of notes to be retrieved. Defaults to 10.
            sinceId (str, optional): If specified, returns notes whose id is greater than its value. Defaults to None.
            untilId (str, optional): If specified, returns notes whose id is less than the value. Defaults to None.

        Returns:
            List (in Dict): notes dict
        """
        base = {"i": self.i, "local": local, "limit": limit}
        if nonecheck(reply):
            base["reply"] = reply
        if nonecheck(renote):
            base["renote"] = renote
        if nonecheck(withFiles):
            base["withFiles"] = withFiles
        if nonecheck(poll):
            base["poll"] = poll
        if nonecheck(sinceId):
            base["sinceId"] = sinceId
        if nonecheck(untilId):
            base["untilId"] = untilId
        return await request(self.address, self.i, "notes", base)


    async def conversation(self, noteId: str, limit: int = 10, offset: int = 0):
        """Retrieve relevant notes.

        Args:
            noteId (str): noteId.
            limit (int, optional): limit of Retrieve. Defaults to 10.
            offset (int, optional): Skip the first offset of the result. Defaults to 0.

        Returns:
            _type_: _description_
        """
        return await request(
            self.address,
            self.i, 
            "notes/conversation",
            {"noteId": noteId, "limit": limit, "offset": offset},
        )


    async def global_timeline(
        self,
        withFiles=False,
        limit=10,
        sinceId=None,
        untilId=None,
        sinceDate=None,
        untilDate=None,
    ):
        """Get the Global Timeline (GTL). The global timeline contains all public posts received by the server.

        Args:
            withFiles (bool, optional): If set to true, only notes with files attached will be retrieved.
            limit (int, optional): Specifies the maximum number of notes to be retrieved. Defaults to 10.
            sinceId (str, optional): If specified, returns notes whose id is greater than its value. Defaults to None.
            untilId (str, optional): If specified, returns notes whose id is less than the value. Defaults to None.
            sinceDate (int, optional): If you specify a date and time in epoch seconds, it returns notes created after that date and time.
            untilDate (int, optional): If you specify a date and time in epoch seconds, it returns notes created before that date and time.

        Returns:
            List (in Dict): notes dict
        """
        base = {"withFiles": withFiles, "limit": limit}
        if nonecheck(sinceId):
            base["sinceId"] = sinceId
        if nonecheck(untilId):
            base["untilId"] = untilId
        if nonecheck(sinceDate):
            base["sinceDate"] = sinceDate
        if nonecheck(untilDate):
            base["untilDate"] = untilDate
        return await request(self.address, self.i, "notes/global-timeline", base)


    async def hybrid_timeline(
        self,
        limit=10,
        sinceId=None,
        untilId=None,
        sinceDate=None,
        untilDate=None,
        includeMyRenotes=True,
        includeRenotedMyNotes=True,
        includeLocalRenotes=True,
        withFiles=False,
    ):
        """Get the social Timeline (STL). The social timeline includes all public notes in the server and those of users you follow.

        Args:
            limit (int, optional): Specifies the maximum number of notes to be retrieved. Defaults to 10.
            sinceId (str, optional): If specified, returns notes whose id is greater than its value. Defaults to None.
            untilId (str, optional): If specified, returns notes whose id is less than the value. Defaults to None.
            sinceDate (int, optional): If you specify a date and time in epoch seconds, it returns notes created after that date and time.
            untilDate (int, optional): If you specify a date and time in epoch seconds, it returns notes created before that date and time.
            includeMyRenotes (bool, optional): If true, include the renotes made by the currently logged in user.
            includeRenotedMyNotes (bool, optional): If true, include the Renotes posted by the currently logged in user.
            includeLocalRenotes (bool, optional): If true, include the renotes made by local users.
            withFiles (bool, optional): If set to true, only notes with files attached will be retrieved.

        Returns:
            List (in Dict): notes dict
        """
        base = {
            "withFiles": withFiles,
            "limit": limit,
            "includeMyRenotes": includeMyRenotes,
            "includeRenotedMyNotes": includeRenotedMyNotes,
            "includeLocalRenotes": includeLocalRenotes,
        }
        if nonecheck(sinceId):
            base["sinceId"] = sinceId
        if nonecheck(untilId):
            base["untilId"] = untilId
        if nonecheck(sinceDate):
            base["sinceDate"] = sinceDate
        if nonecheck(untilDate):
            base["untilDate"] = untilDate
        return await request(self.address, self.i, "notes/hybrid-timeline", base)


    async def home_timeline(
        self,
        limit=10,
        sinceId=None,
        untilId=None,
        sinceDate=None,
        untilDate=None,
        includeMyRenotes=True,
        includeRenotedMyNotes=True,
        includeLocalRenotes=True,
        withFiles=False,
    ):
        """Get Home Timeline (HTL). The home timeline contains the notes of the users you follow.

        Args:
            limit (int, optional): Specifies the maximum number of notes to be retrieved. Defaults to 10.
            sinceId (str, optional): If specified, returns notes whose id is greater than its value. Defaults to None.
            untilId (str, optional): If specified, returns notes whose id is less than the value. Defaults to None.
            sinceDate (int, optional): If you specify a date and time in epoch seconds, it returns notes created after that date and time.
            untilDate (int, optional): If you specify a date and time in epoch seconds, it returns notes created before that date and time.
            includeMyRenotes (bool, optional): If true, include the renotes made by the currently logged in user.
            includeRenotedMyNotes (bool, optional): If true, include the Renotes posted by the currently logged in user.
            includeLocalRenotes (bool, optional): If true, include the renotes made by local users.
            withFiles (bool, optional): If set to true, only notes with files attached will be retrieved.

        Returns:
            List (in Dict): notes dict
        """
        base = {
            "withFiles": withFiles,
            "limit": limit,
            "includeMyRenotes": includeMyRenotes,
            "includeRenotedMyNotes": includeRenotedMyNotes,
            "includeLocalRenotes": includeLocalRenotes,
        }
        if nonecheck(sinceId):
            base["sinceId"] = sinceId
        if nonecheck(untilId):
            base["untilId"] = untilId
        if nonecheck(sinceDate):
            base["sinceDate"] = sinceDate
        if nonecheck(untilDate):
            base["untilDate"] = untilDate
        return await request(self.address, self.i, "notes/timeline", base)


    async def local_timeline(
        self,
        withFiles=False,
        fileType=None,
        excludeNsfw=False,
        limit=10,
        sinceId=None,
        untilId=None,
        sinceDate=None,
        untilDate=None,
    ):
        """Get the Local Timeline (LTL). The local timeline contains all public notes in the server.

        Args:
            withFiles (bool, optional): If set to true, only notes with files attached will be retrieved.
            fileType (bool, optional): Retrieve only those posts with files of the specified type attached.
            excludeNsfw (bool, optional): If true, excludes notes with CWs and notes with NSFW-specified files attached, effective only if fileType is specified (notes with CWs without attachments are not excluded).
            limit (int, optional): Specifies the maximum number of notes to be retrieved. Defaults to 10.
            sinceId (str, optional): If specified, returns notes whose id is greater than its value. Defaults to None.
            untilId (str, optional): If specified, returns notes whose id is less than the value. Defaults to None.
            sinceDate (int, optional): If you specify a date and time in epoch seconds, it returns notes created after that date and time.
            untilDate (int, optional): If you specify a date and time in epoch seconds, it returns notes created before that date and time.
            includeMyRenotes (bool, optional): If true, include the renotes made by the currently logged in user.
            includeRenotedMyNotes (bool, optional): If true, include the Renotes posted by the currently logged in user.
            includeLocalRenotes (bool, optional): If true, include the renotes made by local users.

        Returns:
            List (in Dict): notes dict
        """
        base = {"withFiles": withFiles, "limit": limit, "excludeNsfw": excludeNsfw}
        if nonecheck(fileType):
            base["fileType"] = fileType
        if nonecheck(sinceId):
            base["sinceId"] = sinceId
        if nonecheck(untilId):
            base["untilId"] = untilId
        if nonecheck(sinceDate):
            base["sinceDate"] = sinceDate
        if nonecheck(untilDate):
            base["untilDate"] = untilDate
        return await request(self.address, self.i, "notes/local-timeline", base)


    async def featured(self, limit=10, offset=0):
        """Retrieves highlighted notes. Results are sorted in descending order of note creation time (latest first).

        Args:
            limit (int, optional): Maximum number of notes to be retrieved. Defaults to 10.
            offset (int, optional): The first offset of the search result is skipped. Defaults to 0.

        Returns:
            List (Dict): _description_
        """
        return await request(
            self.address, self.i, "notes/featured", {"limit": limit, "offset": offset}
        )


    async def favorites_create(self, noteId):
        """create favorites.

        Args:
            noteId (str): noteId.

        Returns:
            Dict: _description_
        """
        return await request(self.address, self.i, "notes/favorites/create", {"noteId": noteId})


    async def favorites_delete(self, noteId):
        """delete favorites

        Args:
            noteId (str): noteId.

        Returns:
            Dict: _description_
        """
        return await request(self.address, self.i, "notes/favorites/delete", {"noteId": noteId})


    async def polls_recommendation(self, limit=10, offset=0):
        """Get a list of recommended notes with a survey.

        Args:
            limit (int, optional): Maximum number of notes to be retrieved. Defaults to 10.
            offset (int, optional): The first offset of the search result is skipped. Defaults to 0.

        Returns:
            _type_: _description_
        """
        return await request(
            self.address, self.i, "notes/polls/recommendation", {"limit": limit, "offset": offset}
        )


    async def polls_vote(self, noteId, choice):
        """Vote in the notebook poll. To vote for multiple choices, change the choice and make multiple requests.

        Args:
            noteId (str): ID of the note to which the survey is attached.
            choice (str): Choices to vote on.

        Returns:
            _type_: _description_
        """
        return await request(
            self.address, self.i, "notes/polls/vote", {"noteId": noteId, "choice": choice}
        )


    async def reactions(
        self,
        noteId: str,
        type: str = None,
        limit: int = 10,
        offset: int = 0,
        sinceId: str = None,
        untilId: str = None,
    ):
        base = {"noteId": noteId, "type": type, "limit": limit, "offset": offset}
        if nonecheck(sinceId):
            base["sinceId"] = sinceId
        if nonecheck(untilId):
            base["untilId"] = untilId
        return await request(self.address, self.i, "notes/reactions", base)


    async def replies(
        self, noteId: str, sinceId: str = None, untilId: str = None, limit: int = 10
    ):
        base = {"noteId": noteId, "limit": limit}
        if nonecheck(sinceId):
            base["sinceId"] = sinceId
        if nonecheck(untilId):
            base["untilId"] = untilId
        return await request(self.address, self.i, "notes/replies", base)


    async def search(
        self,
        reply=False,
        renote=False,
        withFiles=False,
        poll=False,
        sinceId=None,
        untilId=None,
        limit=10,
    ):
        base = {
            "reply": reply,
            "renote": renote,
            "withFiles": withFiles,
            "poll": poll,
            "limit": limit,
        }
        if nonecheck(sinceId):
            base["sinceId"] = sinceId
        if nonecheck(untilId):
            base["untilId"] = untilId
        return await request(self.address, self.i, "notes/search-by-tag", base)


    async def search_by_tag(
        self,
        query,
        sinceId=None,
        untilId=None,
        limit=10,
        offset=0,
        host=None,
        userId=None,
        channelId=None,
    ):
        base = {
            "query": query,
            "offset": offset,
            "limit": limit,
            "host": host,
            "userId": userId,
            "channelId": channelId,
        }
        if nonecheck(sinceId):
            base["sinceId"] = sinceId
        if nonecheck(untilId):
            base["untilId"] = untilId
        return await request(self.address, self.i, "notes/search", base)


    async def state(self, noteId):
        return await request(self.address, self.i, "notes/state", {"noteId": noteId})


    async def show(self, noteId):
        return await request(self.address, self.i, "notes/show", {"noteId": noteId})


    async def thread_muting_create(self, noteId):
        return await request(self.address, self.i, "notes/thread-muting/create", {"noteId": noteId})


    async def thread_muting_delete(self, noteId):
        return await request(self.address, self.i, "notes/thread-muting/delete", {"noteId": noteId})


    async def translate(self, noteId, targetLang):
        return await request(
            self.address, self.i, "notes/translate", {"noteId": noteId, "targetLang": targetLang}
        )


    async def unrenote(self, noteId):
        return await request(self.address, self.i, "notes/unrenote", {"noteId": noteId})


    async def user_list_timeline(
        self,
        listId,
        limit=10,
        sinceId=None,
        untilId=None,
        sinceDate=0,
        untilDate=0,
        includeMyRenotes=True,
        includeRenotedMyNotes=True,
        includeLocalRenotes=True,
        withFiles=False,
    ):
        base = {
            "listId": listId,
            "limit": limit,
            "sinceDate": sinceDate,
            "untilDate": untilDate,
            "includeMyRenotes": includeMyRenotes,
            "includeRenotedMyNotes": includeRenotedMyNotes,
            "includeLocalRenotes": includeLocalRenotes,
            "withFiles": withFiles,
        }
        if nonecheck(sinceId):
            base["sinceId"] = sinceId
        if nonecheck(untilId):
            base["untilId"] = untilId
        return await request(self.address, self.i, "notes/user-list-timeline", base)


    async def watching_create(self, noteId):
        return await request(self.address, self.i, "notes/watching/create", {"noteId": noteId})


    async def watching_delete(self, noteId):
        return await request(self.address, self.i, "notes/watching/delete", {"noteId": noteId})


    async def mentions(
        self, following=False, limit=10, sinceId=None, untilId=None, visibility=None
    ):
        base = {"following": following, "limit": limit}
        if nonecheck(sinceId):
            base["sinceId"] = sinceId
        if nonecheck(untilId):
            base["untilId"] = untilId
        if nonecheck(visibility):
            base["visibility"] = visibility
        return await request(self.address, self.i, "notes/mentions", base)


    async def create(
        self,
        text: str = None,
        visibility="public",
        visibleUserIds: list = None,
        cw=None,
        replyid=None,
        fileid=None,
        channelId=None,
        localOnly: bool = False,
        renoteId=None,
        noExtractMentions: bool = False,
        noExtractEmojis: bool = False,
        poll=None,
    ):  # 82行→57行に短くできた
        """Create notes. Reply and Renote are also done with this function.

        Args:
            address (str): misskey server address
            i (str): misskey api token
            text (str): note content
            visibility (str): Public scope of the note. Defaults to "public".
            visibleUserIds (list, optional): ID of the user as seen for direct notes. Defaults to None.
            replyid (_type_, optional): the id of the note to reply to. Defaults to None.
            fileid (_type_, optional): notes attached file id. Defaults to None.
            channelId (_type_, optional): The id of the channel to post to. Defaults to None.
            localOnly (bool, optional): If true, posts to local timeline only.. Defaults to False.
            renoteId (_type_, optional): the id of the note to renote to.. Defaults to None.

        Returns:
            dict: Misskey API response
        """
        base = {
            "visibility": visibility,
            "localOnly": localOnly,
            "noExtractMentions": noExtractMentions,
            "noExtractEmojis": noExtractEmojis,
            "cw": cw
        }
        if poll is not None:
            base["poll"] = {}
            base["poll"]["choices"] = poll.choices
            base["poll"]["multiple"] = poll.multiple
            base["poll"]["expiresAt"] = poll.expiresAt
            base["poll"]["expiredAfter"] = poll.expiredAfter
        if text is not None:
            base["text"] = text
        if visibleUserIds is not None:
            base["visibleUserIds"] = visibleUserIds
        if replyid is not None:
            base["replyid"] = replyid
        if fileid is not None:
            base["fileIds"] = fileid
        if channelId is not None:
            base["channelId"] = channelId
        if renoteId is not None:
            base["renoteId"] = renoteId
        req = await request(
            self.address, self.i, "notes/create", base, header={"Content-Type": "application/json"}
        )
        return req


    async def delete(self, noteId):
        return await request(self.address, self.i, "notes/delete", {"noteId": noteId})


    async def children(self, noteId, limit, sinceId, untilId):
        base = {"noteId": noteId, "limit": limit}
        if nonecheck(sinceId):
            base["sinceId"] = sinceId
        if nonecheck(untilId):
            base["untilId"] = untilId
        return await request(self.address, self.i, "notes/children", base)

conversation(noteId, limit=10, offset=0) async

Retrieve relevant notes.

Parameters:

Name Type Description Default
noteId str

noteId.

required
limit int

limit of Retrieve. Defaults to 10.

10
offset int

Skip the first offset of the result. Defaults to 0.

0

Returns:

Name Type Description
_type_

description

Source code in misspy/notes.py
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
async def conversation(self, noteId: str, limit: int = 10, offset: int = 0):
    """Retrieve relevant notes.

    Args:
        noteId (str): noteId.
        limit (int, optional): limit of Retrieve. Defaults to 10.
        offset (int, optional): Skip the first offset of the result. Defaults to 0.

    Returns:
        _type_: _description_
    """
    return await request(
        self.address,
        self.i, 
        "notes/conversation",
        {"noteId": noteId, "limit": limit, "offset": offset},
    )

create(text=None, visibility='public', visibleUserIds=None, cw=None, replyid=None, fileid=None, channelId=None, localOnly=False, renoteId=None, noExtractMentions=False, noExtractEmojis=False, poll=None) async

Create notes. Reply and Renote are also done with this function.

Parameters:

Name Type Description Default
address str

misskey server address

required
i str

misskey api token

required
text str

note content

None
visibility str

Public scope of the note. Defaults to "public".

'public'
visibleUserIds list

ID of the user as seen for direct notes. Defaults to None.

None
replyid _type_

the id of the note to reply to. Defaults to None.

None
fileid _type_

notes attached file id. Defaults to None.

None
channelId _type_

The id of the channel to post to. Defaults to None.

None
localOnly bool

If true, posts to local timeline only.. Defaults to False.

False
renoteId _type_

the id of the note to renote to.. Defaults to None.

None

Returns:

Name Type Description
dict

Misskey API response

Source code in misspy/notes.py
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
async def create(
    self,
    text: str = None,
    visibility="public",
    visibleUserIds: list = None,
    cw=None,
    replyid=None,
    fileid=None,
    channelId=None,
    localOnly: bool = False,
    renoteId=None,
    noExtractMentions: bool = False,
    noExtractEmojis: bool = False,
    poll=None,
):  # 82行→57行に短くできた
    """Create notes. Reply and Renote are also done with this function.

    Args:
        address (str): misskey server address
        i (str): misskey api token
        text (str): note content
        visibility (str): Public scope of the note. Defaults to "public".
        visibleUserIds (list, optional): ID of the user as seen for direct notes. Defaults to None.
        replyid (_type_, optional): the id of the note to reply to. Defaults to None.
        fileid (_type_, optional): notes attached file id. Defaults to None.
        channelId (_type_, optional): The id of the channel to post to. Defaults to None.
        localOnly (bool, optional): If true, posts to local timeline only.. Defaults to False.
        renoteId (_type_, optional): the id of the note to renote to.. Defaults to None.

    Returns:
        dict: Misskey API response
    """
    base = {
        "visibility": visibility,
        "localOnly": localOnly,
        "noExtractMentions": noExtractMentions,
        "noExtractEmojis": noExtractEmojis,
        "cw": cw
    }
    if poll is not None:
        base["poll"] = {}
        base["poll"]["choices"] = poll.choices
        base["poll"]["multiple"] = poll.multiple
        base["poll"]["expiresAt"] = poll.expiresAt
        base["poll"]["expiredAfter"] = poll.expiredAfter
    if text is not None:
        base["text"] = text
    if visibleUserIds is not None:
        base["visibleUserIds"] = visibleUserIds
    if replyid is not None:
        base["replyid"] = replyid
    if fileid is not None:
        base["fileIds"] = fileid
    if channelId is not None:
        base["channelId"] = channelId
    if renoteId is not None:
        base["renoteId"] = renoteId
    req = await request(
        self.address, self.i, "notes/create", base, header={"Content-Type": "application/json"}
    )
    return req

favorites_create(noteId) async

create favorites.

Parameters:

Name Type Description Default
noteId str

noteId.

required

Returns:

Name Type Description
Dict

description

Source code in misspy/notes.py
261
262
263
264
265
266
267
268
269
270
async def favorites_create(self, noteId):
    """create favorites.

    Args:
        noteId (str): noteId.

    Returns:
        Dict: _description_
    """
    return await request(self.address, self.i, "notes/favorites/create", {"noteId": noteId})

favorites_delete(noteId) async

delete favorites

Parameters:

Name Type Description Default
noteId str

noteId.

required

Returns:

Name Type Description
Dict

description

Source code in misspy/notes.py
273
274
275
276
277
278
279
280
281
282
async def favorites_delete(self, noteId):
    """delete favorites

    Args:
        noteId (str): noteId.

    Returns:
        Dict: _description_
    """
    return await request(self.address, self.i, "notes/favorites/delete", {"noteId": noteId})

featured(limit=10, offset=0) async

Retrieves highlighted notes. Results are sorted in descending order of note creation time (latest first).

Parameters:

Name Type Description Default
limit int

Maximum number of notes to be retrieved. Defaults to 10.

10
offset int

The first offset of the search result is skipped. Defaults to 0.

0

Returns:

Name Type Description
List Dict

description

Source code in misspy/notes.py
246
247
248
249
250
251
252
253
254
255
256
257
258
async def featured(self, limit=10, offset=0):
    """Retrieves highlighted notes. Results are sorted in descending order of note creation time (latest first).

    Args:
        limit (int, optional): Maximum number of notes to be retrieved. Defaults to 10.
        offset (int, optional): The first offset of the search result is skipped. Defaults to 0.

    Returns:
        List (Dict): _description_
    """
    return await request(
        self.address, self.i, "notes/featured", {"limit": limit, "offset": offset}
    )

global_timeline(withFiles=False, limit=10, sinceId=None, untilId=None, sinceDate=None, untilDate=None) async

Get the Global Timeline (GTL). The global timeline contains all public posts received by the server.

Parameters:

Name Type Description Default
withFiles bool

If set to true, only notes with files attached will be retrieved.

False
limit int

Specifies the maximum number of notes to be retrieved. Defaults to 10.

10
sinceId str

If specified, returns notes whose id is greater than its value. Defaults to None.

None
untilId str

If specified, returns notes whose id is less than the value. Defaults to None.

None
sinceDate int

If you specify a date and time in epoch seconds, it returns notes created after that date and time.

None
untilDate int

If you specify a date and time in epoch seconds, it returns notes created before that date and time.

None

Returns:

Name Type Description
List in Dict

notes dict

Source code in misspy/notes.py
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
async def global_timeline(
    self,
    withFiles=False,
    limit=10,
    sinceId=None,
    untilId=None,
    sinceDate=None,
    untilDate=None,
):
    """Get the Global Timeline (GTL). The global timeline contains all public posts received by the server.

    Args:
        withFiles (bool, optional): If set to true, only notes with files attached will be retrieved.
        limit (int, optional): Specifies the maximum number of notes to be retrieved. Defaults to 10.
        sinceId (str, optional): If specified, returns notes whose id is greater than its value. Defaults to None.
        untilId (str, optional): If specified, returns notes whose id is less than the value. Defaults to None.
        sinceDate (int, optional): If you specify a date and time in epoch seconds, it returns notes created after that date and time.
        untilDate (int, optional): If you specify a date and time in epoch seconds, it returns notes created before that date and time.

    Returns:
        List (in Dict): notes dict
    """
    base = {"withFiles": withFiles, "limit": limit}
    if nonecheck(sinceId):
        base["sinceId"] = sinceId
    if nonecheck(untilId):
        base["untilId"] = untilId
    if nonecheck(sinceDate):
        base["sinceDate"] = sinceDate
    if nonecheck(untilDate):
        base["untilDate"] = untilDate
    return await request(self.address, self.i, "notes/global-timeline", base)

home_timeline(limit=10, sinceId=None, untilId=None, sinceDate=None, untilDate=None, includeMyRenotes=True, includeRenotedMyNotes=True, includeLocalRenotes=True, withFiles=False) async

Get Home Timeline (HTL). The home timeline contains the notes of the users you follow.

Parameters:

Name Type Description Default
limit int

Specifies the maximum number of notes to be retrieved. Defaults to 10.

10
sinceId str

If specified, returns notes whose id is greater than its value. Defaults to None.

None
untilId str

If specified, returns notes whose id is less than the value. Defaults to None.

None
sinceDate int

If you specify a date and time in epoch seconds, it returns notes created after that date and time.

None
untilDate int

If you specify a date and time in epoch seconds, it returns notes created before that date and time.

None
includeMyRenotes bool

If true, include the renotes made by the currently logged in user.

True
includeRenotedMyNotes bool

If true, include the Renotes posted by the currently logged in user.

True
includeLocalRenotes bool

If true, include the renotes made by local users.

True
withFiles bool

If set to true, only notes with files attached will be retrieved.

False

Returns:

Name Type Description
List in Dict

notes dict

Source code in misspy/notes.py
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
async def home_timeline(
    self,
    limit=10,
    sinceId=None,
    untilId=None,
    sinceDate=None,
    untilDate=None,
    includeMyRenotes=True,
    includeRenotedMyNotes=True,
    includeLocalRenotes=True,
    withFiles=False,
):
    """Get Home Timeline (HTL). The home timeline contains the notes of the users you follow.

    Args:
        limit (int, optional): Specifies the maximum number of notes to be retrieved. Defaults to 10.
        sinceId (str, optional): If specified, returns notes whose id is greater than its value. Defaults to None.
        untilId (str, optional): If specified, returns notes whose id is less than the value. Defaults to None.
        sinceDate (int, optional): If you specify a date and time in epoch seconds, it returns notes created after that date and time.
        untilDate (int, optional): If you specify a date and time in epoch seconds, it returns notes created before that date and time.
        includeMyRenotes (bool, optional): If true, include the renotes made by the currently logged in user.
        includeRenotedMyNotes (bool, optional): If true, include the Renotes posted by the currently logged in user.
        includeLocalRenotes (bool, optional): If true, include the renotes made by local users.
        withFiles (bool, optional): If set to true, only notes with files attached will be retrieved.

    Returns:
        List (in Dict): notes dict
    """
    base = {
        "withFiles": withFiles,
        "limit": limit,
        "includeMyRenotes": includeMyRenotes,
        "includeRenotedMyNotes": includeRenotedMyNotes,
        "includeLocalRenotes": includeLocalRenotes,
    }
    if nonecheck(sinceId):
        base["sinceId"] = sinceId
    if nonecheck(untilId):
        base["untilId"] = untilId
    if nonecheck(sinceDate):
        base["sinceDate"] = sinceDate
    if nonecheck(untilDate):
        base["untilDate"] = untilDate
    return await request(self.address, self.i, "notes/timeline", base)

hybrid_timeline(limit=10, sinceId=None, untilId=None, sinceDate=None, untilDate=None, includeMyRenotes=True, includeRenotedMyNotes=True, includeLocalRenotes=True, withFiles=False) async

Get the social Timeline (STL). The social timeline includes all public notes in the server and those of users you follow.

Parameters:

Name Type Description Default
limit int

Specifies the maximum number of notes to be retrieved. Defaults to 10.

10
sinceId str

If specified, returns notes whose id is greater than its value. Defaults to None.

None
untilId str

If specified, returns notes whose id is less than the value. Defaults to None.

None
sinceDate int

If you specify a date and time in epoch seconds, it returns notes created after that date and time.

None
untilDate int

If you specify a date and time in epoch seconds, it returns notes created before that date and time.

None
includeMyRenotes bool

If true, include the renotes made by the currently logged in user.

True
includeRenotedMyNotes bool

If true, include the Renotes posted by the currently logged in user.

True
includeLocalRenotes bool

If true, include the renotes made by local users.

True
withFiles bool

If set to true, only notes with files attached will be retrieved.

False

Returns:

Name Type Description
List in Dict

notes dict

Source code in misspy/notes.py
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
async def hybrid_timeline(
    self,
    limit=10,
    sinceId=None,
    untilId=None,
    sinceDate=None,
    untilDate=None,
    includeMyRenotes=True,
    includeRenotedMyNotes=True,
    includeLocalRenotes=True,
    withFiles=False,
):
    """Get the social Timeline (STL). The social timeline includes all public notes in the server and those of users you follow.

    Args:
        limit (int, optional): Specifies the maximum number of notes to be retrieved. Defaults to 10.
        sinceId (str, optional): If specified, returns notes whose id is greater than its value. Defaults to None.
        untilId (str, optional): If specified, returns notes whose id is less than the value. Defaults to None.
        sinceDate (int, optional): If you specify a date and time in epoch seconds, it returns notes created after that date and time.
        untilDate (int, optional): If you specify a date and time in epoch seconds, it returns notes created before that date and time.
        includeMyRenotes (bool, optional): If true, include the renotes made by the currently logged in user.
        includeRenotedMyNotes (bool, optional): If true, include the Renotes posted by the currently logged in user.
        includeLocalRenotes (bool, optional): If true, include the renotes made by local users.
        withFiles (bool, optional): If set to true, only notes with files attached will be retrieved.

    Returns:
        List (in Dict): notes dict
    """
    base = {
        "withFiles": withFiles,
        "limit": limit,
        "includeMyRenotes": includeMyRenotes,
        "includeRenotedMyNotes": includeRenotedMyNotes,
        "includeLocalRenotes": includeLocalRenotes,
    }
    if nonecheck(sinceId):
        base["sinceId"] = sinceId
    if nonecheck(untilId):
        base["untilId"] = untilId
    if nonecheck(sinceDate):
        base["sinceDate"] = sinceDate
    if nonecheck(untilDate):
        base["untilDate"] = untilDate
    return await request(self.address, self.i, "notes/hybrid-timeline", base)

local_timeline(withFiles=False, fileType=None, excludeNsfw=False, limit=10, sinceId=None, untilId=None, sinceDate=None, untilDate=None) async

Get the Local Timeline (LTL). The local timeline contains all public notes in the server.

Parameters:

Name Type Description Default
withFiles bool

If set to true, only notes with files attached will be retrieved.

False
fileType bool

Retrieve only those posts with files of the specified type attached.

None
excludeNsfw bool

If true, excludes notes with CWs and notes with NSFW-specified files attached, effective only if fileType is specified (notes with CWs without attachments are not excluded).

False
limit int

Specifies the maximum number of notes to be retrieved. Defaults to 10.

10
sinceId str

If specified, returns notes whose id is greater than its value. Defaults to None.

None
untilId str

If specified, returns notes whose id is less than the value. Defaults to None.

None
sinceDate int

If you specify a date and time in epoch seconds, it returns notes created after that date and time.

None
untilDate int

If you specify a date and time in epoch seconds, it returns notes created before that date and time.

None
includeMyRenotes bool

If true, include the renotes made by the currently logged in user.

required
includeRenotedMyNotes bool

If true, include the Renotes posted by the currently logged in user.

required
includeLocalRenotes bool

If true, include the renotes made by local users.

required

Returns:

Name Type Description
List in Dict

notes dict

Source code in misspy/notes.py
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
async def local_timeline(
    self,
    withFiles=False,
    fileType=None,
    excludeNsfw=False,
    limit=10,
    sinceId=None,
    untilId=None,
    sinceDate=None,
    untilDate=None,
):
    """Get the Local Timeline (LTL). The local timeline contains all public notes in the server.

    Args:
        withFiles (bool, optional): If set to true, only notes with files attached will be retrieved.
        fileType (bool, optional): Retrieve only those posts with files of the specified type attached.
        excludeNsfw (bool, optional): If true, excludes notes with CWs and notes with NSFW-specified files attached, effective only if fileType is specified (notes with CWs without attachments are not excluded).
        limit (int, optional): Specifies the maximum number of notes to be retrieved. Defaults to 10.
        sinceId (str, optional): If specified, returns notes whose id is greater than its value. Defaults to None.
        untilId (str, optional): If specified, returns notes whose id is less than the value. Defaults to None.
        sinceDate (int, optional): If you specify a date and time in epoch seconds, it returns notes created after that date and time.
        untilDate (int, optional): If you specify a date and time in epoch seconds, it returns notes created before that date and time.
        includeMyRenotes (bool, optional): If true, include the renotes made by the currently logged in user.
        includeRenotedMyNotes (bool, optional): If true, include the Renotes posted by the currently logged in user.
        includeLocalRenotes (bool, optional): If true, include the renotes made by local users.

    Returns:
        List (in Dict): notes dict
    """
    base = {"withFiles": withFiles, "limit": limit, "excludeNsfw": excludeNsfw}
    if nonecheck(fileType):
        base["fileType"] = fileType
    if nonecheck(sinceId):
        base["sinceId"] = sinceId
    if nonecheck(untilId):
        base["untilId"] = untilId
    if nonecheck(sinceDate):
        base["sinceDate"] = sinceDate
    if nonecheck(untilDate):
        base["untilDate"] = untilDate
    return await request(self.address, self.i, "notes/local-timeline", base)

note(local=False, reply=None, renote=None, withFiles=None, poll=None, limit=10, sinceId=None, untilId=None) async

Retrieves the list of notes.

Parameters:

Name Type Description Default
local bool

Only locally created notes are retrieved. Defaults to False.

False
reply bool

If true, only replies are retrieved; if false, non-replies are retrieved. If no value is set, notes are retrieved regardless of whether they are replies or not. Defaults to None.

None
renote bool

If true, only renotes are retrieved; if false, non-renotes are retrieved. If no value is set, notes are retrieved regardless of whether they are replies or not. Defaults to None.

None
withFiles bool

If true, only notes with attachments will be retrieved; if false, only notes without attachments will be retrieved. If no value is set, notes are retrieved with or without attachments. Defaults to None.

None
poll bool

If true, only notes with votes will be retrieved; if false, only notes without votes will be retrieved. If no value is set, notes are retrieved with or without votes. Defaults to None.

None
limit int

Specifies the maximum number of notes to be retrieved. Defaults to 10.

10
sinceId str

If specified, returns notes whose id is greater than its value. Defaults to None.

None
untilId str

If specified, returns notes whose id is less than the value. Defaults to None.

None

Returns:

Name Type Description
List in Dict

notes dict

Source code in misspy/notes.py
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
async def note(
    self,
    local: bool = False,
    reply: bool = None,
    renote: bool = None,
    withFiles: bool = None,
    poll: bool = None,
    limit: int = 10,
    sinceId: str = None,
    untilId: str = None,
):
    """Retrieves the list of notes.

    Args:
        local (bool, optional): Only locally created notes are retrieved. Defaults to False.
        reply (bool, optional): If `true`, only replies are retrieved; if `false`, non-replies are retrieved. If no value is set, notes are retrieved regardless of whether they are replies or not. Defaults to None.
        renote (bool, optional): If `true`, only renotes are retrieved; if `false`, non-renotes are retrieved. If no value is set, notes are retrieved regardless of whether they are replies or not. Defaults to None.
        withFiles (bool, optional): If `true`, only notes with attachments will be retrieved; if `false`, only notes without attachments will be retrieved. If no value is set, notes are retrieved with or without attachments. Defaults to None.
        poll (bool, optional): If `true`, only notes with votes will be retrieved; if `false`, only notes without votes will be retrieved. If no value is set, notes are retrieved with or without votes. Defaults to None.
        limit (int, optional): Specifies the maximum number of notes to be retrieved. Defaults to 10.
        sinceId (str, optional): If specified, returns notes whose id is greater than its value. Defaults to None.
        untilId (str, optional): If specified, returns notes whose id is less than the value. Defaults to None.

    Returns:
        List (in Dict): notes dict
    """
    base = {"i": self.i, "local": local, "limit": limit}
    if nonecheck(reply):
        base["reply"] = reply
    if nonecheck(renote):
        base["renote"] = renote
    if nonecheck(withFiles):
        base["withFiles"] = withFiles
    if nonecheck(poll):
        base["poll"] = poll
    if nonecheck(sinceId):
        base["sinceId"] = sinceId
    if nonecheck(untilId):
        base["untilId"] = untilId
    return await request(self.address, self.i, "notes", base)

polls_recommendation(limit=10, offset=0) async

Get a list of recommended notes with a survey.

Parameters:

Name Type Description Default
limit int

Maximum number of notes to be retrieved. Defaults to 10.

10
offset int

The first offset of the search result is skipped. Defaults to 0.

0

Returns:

Name Type Description
_type_

description

Source code in misspy/notes.py
285
286
287
288
289
290
291
292
293
294
295
296
297
async def polls_recommendation(self, limit=10, offset=0):
    """Get a list of recommended notes with a survey.

    Args:
        limit (int, optional): Maximum number of notes to be retrieved. Defaults to 10.
        offset (int, optional): The first offset of the search result is skipped. Defaults to 0.

    Returns:
        _type_: _description_
    """
    return await request(
        self.address, self.i, "notes/polls/recommendation", {"limit": limit, "offset": offset}
    )

polls_vote(noteId, choice) async

Vote in the notebook poll. To vote for multiple choices, change the choice and make multiple requests.

Parameters:

Name Type Description Default
noteId str

ID of the note to which the survey is attached.

required
choice str

Choices to vote on.

required

Returns:

Name Type Description
_type_

description

Source code in misspy/notes.py
300
301
302
303
304
305
306
307
308
309
310
311
312
async def polls_vote(self, noteId, choice):
    """Vote in the notebook poll. To vote for multiple choices, change the choice and make multiple requests.

    Args:
        noteId (str): ID of the note to which the survey is attached.
        choice (str): Choices to vote on.

    Returns:
        _type_: _description_
    """
    return await request(
        self.address, self.i, "notes/polls/vote", {"noteId": noteId, "choice": choice}
    )