简体   繁体   中英

PRAW: How to mark_as_read() with just the message ID?

I just have a list of messages IDs that I need to mark_as_read() , I don't need the message contents, just mark it as read.

Is it possible to mark them as read without fetching them first?

Super late reply, sorry. In case you are still looking, here you go:

You should be able to create a new instance of a message object. Like so:

import praw
reddit = praw.Reddit('Bot-name')
msgIDs = ['id1','id2','id3']
for id in msgIDs:
    temp = reddit.message('id')
    mark_as_read(temp)

If you have any further questions feel free to ask.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM