Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/289.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python PRAW:如何仅使用消息ID将_标记为_read()?_Python_Reddit_Praw - Fatal编程技术网

Python PRAW:如何仅使用消息ID将_标记为_read()?

Python PRAW:如何仅使用消息ID将_标记为_read()?,python,reddit,praw,Python,Reddit,Praw,我只是有一个消息ID列表,我需要将其标记为\u read(),我不需要消息内容,只需将其标记为read即可 是否可以在不首先获取它们的情况下将它们标记为已读?非常晚回复,抱歉。如果您仍在寻找,请看: 您应该能够创建消息对象的新实例。像这样: import praw reddit = praw.Reddit('Bot-name') msgIDs = ['id1','id2','id3'] for id in msgIDs: temp = reddit.message('id') m

我只是有一个消息ID列表,我需要
将其标记为\u read()
,我不需要消息内容,只需将其标记为read即可


是否可以在不首先获取它们的情况下将它们标记为已读?

非常晚回复,抱歉。如果您仍在寻找,请看:

您应该能够创建
消息
对象的新实例。像这样:

import praw
reddit = praw.Reddit('Bot-name')
msgIDs = ['id1','id2','id3']
for id in msgIDs:
    temp = reddit.message('id')
    mark_as_read(temp)
如果您还有任何问题,请随时提问