我正在用PRAW开发一个Reddit机器人,我想在它的回复中有机器人回复的人的用户名。你知道吗
for comment in comments:
comment_text = comment.body.lower()
isMatch = any(string in comment_text for string in words_to_match)
if comment.id not in cache and isMatch:
print("Comment match found;" + comment.id)
comment.reply('Hello + author.name')
print("Reply successful!")
cache.append(comment.id)
但是,这不起作用,它只是像预期的那样以文本形式回复。可以用评论的用户名回复,然后再加上更多的文本吗?你知道吗
您可以通过以下方式将作者作为注释对象的字符串
相关问题 更多 >
编程相关推荐