reply_post¶
- PyPtt.API.reply_post(self, reply_to: ReplyTo, board: str, content: str, sign_file: [str | int] = 0, aid: str | None = None, index: int = 0) → None
回覆文章。
- 參數:
reply_to (ReplyTo) -- 回覆類型。
board (str) -- 看板名稱。
content (str) -- 回覆內容。
sign_file (str | int) -- 編號或隨機簽名檔 (x),預設為 0 (不選)。
aid -- 文章編號。
index -- 文章編號。
- 回傳:
None
- 引發:
RequireLogin -- 需要登入。
NoSuchBoard -- 看板不存在。
NoSuchPost -- 文章不存在。
NoPermission -- 沒有回覆權限。
CantResponse -- 已結案並標記, 不得回應。
範例:
import PyPtt ptt_bot = PyPtt.API() try: # .. login .. ptt_bot.reply_post(reply_to=PyPtt.ReplyTo.BOARD, board='Test', content='PyPtt 程式回覆測試', index=123) # .. do something .. finally: ptt_bot.logout()