mark_post¶
- PyPtt.API.mark_post(self, mark_type: int, board: str, aid: str | None = None, index: int = 0, search_type: int = 0, search_condition: str | None = None) None
標記文章。
- 參數:
mark_type (MarkType) -- 標記類型。
board (str) -- 看板名稱。
aid (str) -- 文章編號。
index (int) -- 文章編號。
search_type (SearchType) -- 搜尋類型。
search_condition (str) -- 搜尋條件。
- 回傳:
None
- 引發:
RequireLogin -- 需要登入。
UnregisteredUser -- 未註冊使用者。
NoSuchBoard -- 看板不存在。
NoSuchPost -- 文章不存在。
NeedModeratorPermission -- 需要看板管理員權限。
範例:
import PyPtt ptt_bot = PyPtt.API() try: # .. login .. ptt_bot.mark_post(mark_type=PyPtt.MarkType.M, board='Test', index=123) # .. do something .. finally: ptt_bot.logout()