我正在用 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)
但是,这不起作用,它只是像预期的那样以文本形式回复。是否可以使用评论的用户名进行回复,然后再添加更多文字?