MarshalX / atproto

The AT Protocol (🦋 Bluesky) SDK for Python 🐍
https://atproto.blue
MIT License
267 stars 29 forks source link

delete_post not work #341

Closed afrizal423 closed 1 month ago

afrizal423 commented 1 month ago
 raise exceptions.BadRequestError(error_response)
atproto_client.exceptions.BadRequestError: Response(success=False, status_code=400, content=XrpcError(error='InvalidRequest', message='Input/repo must be a valid did or a handle'), headers={'Date': 'Mon, 17 Jun 2024 04:58:07 GMT', 'Content-Type': 'application/json; charset=utf-8', 'Content-Length': '81', 'Connection': 'keep-alive', 'X-Powered-By': 'Express', 'Access-Control-Allow-Origin': '*', 'ETag': 'W/"51-YuSfFFAs4Bhu5p38J588fpGYISo"', 'Vary': 'Accept-Encoding'})

Delete post not working, I'm just following this example https://github.com/MarshalX/atproto/blob/main/examples/delete_post.py

MarshalX commented 1 month ago

Show the full code pls. Are you sure that is 1:1 as the example?

afrizal423 commented 1 month ago

I tried it exactly as shown in the example. and get a return value like that. I just changed the handle and password

MarshalX commented 1 month ago

@afrizal423 ah. looks like the example is outdated. pls try this

client = Client()
client.login('my-handle', 'my-password')

post_ref = client.send_post('Test send-delete from Python SDK')
print('Post reference:', post_ref)

print('Post URI:', post_ref.uri)
print('Deleted successfully:', client.delete_post(post_ref.uri))