File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -169,6 +169,18 @@ async def create_preauth(
169169 self ._raise_for_error (resp )
170170 return resp .json ()
171171
172+ async def get_preauth (self , preauth_id : int ) -> dict :
173+ """Get a single preauthorization with remaining budget."""
174+ resp = await self ._http .get (f"/api/preauth/{ preauth_id } " )
175+ self ._raise_for_error (resp )
176+ return resp .json ()
177+
178+ async def revoke_preauth (self , preauth_id : int ) -> dict :
179+ """Revoke an active preauthorization."""
180+ resp = await self ._http .post (f"/api/preauth/{ preauth_id } /revoke" )
181+ self ._raise_for_error (resp )
182+ return resp .json ()
183+
172184 async def get_preauths (self , * , user_id : int | None = None ) -> list [dict ]:
173185 """List preauths for this bot, optionally filtered by user_id."""
174186 params : dict [str , Any ] = {}
You can’t perform that action at this time.
0 commit comments