用 PRAW 修饰帖子

问题描述

我正在使用 PRAW,这是一个 Python Reddit API 客户端。我正在尝试向需要天赋的 subreddit 提交帖子。到目前为止,这是我的代码:

subreddit = reddit.subreddit("test")
subreddit.submit(random.choice(p),selftext=random.choice(pc))

然而,在尝试提交之后...

praw.exceptions.RedditAPIException: SUBMIT_VALIDATION_FLAIR_REQUIRED: 'Your post must contain post flair.' on field 'flair'

添加天赋值后:

subreddit.submit(random.choice(p),selftext=random.choice(pc),flair="other")
TypeError: submit() got an unexpected keyword argument 'flair'

如何为我的帖子添加风格? (我只能找到相关的帖子 is this outdated answer

解决方法

https://praw.readthedocs.io/en/latest/code_overview/models/subreddit.html#praw.models.Subreddit.submit

根据模板的 flair_id 值使用 flair_textflair_text_editable

相关问答

依赖报错 idea导入项目后依赖报错,解决方案:https://blog....
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下...
错误1:gradle项目控制台输出为乱码 # 解决方案:https://bl...
错误还原:在查询的过程中,传入的workType为0时,该条件不起...
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct...