instagrapi icon indicating copy to clipboard operation
instagrapi copied to clipboard

[BUG] direct_message_delete returning success without deleting the message specified.

Open Nick-Gkaragkounis opened this issue 3 years ago • 1 comments

I log in to an Instagram account using the login_by_session_id method(with a saved session). When I try to make a direct_message_delete request with a valid thread and message id(I'm the sender of the message) the function returns success(response["status"] is True) and doesn't error my code, however, the message doesn't actually get deleted on the website(direct_messages function returns it after deletion as well in my messages loop causing my script to run for an infinite amount of time).

Desktop

  • OS: Windows 10
  • Python version: 3.10.7
  • instagrapi version: 1.16.29

Additional context When I first started using the API the messages were actually being deleted, however, the problem started occurring after I switched to using saved sessions and logging in to an account using login_by_session_id, before I switched to using this method(for efficiency reasons) I left my project aside for around 3 days, so the bug may have appeared during this time period and have nothing to do with the above claim.

Nick-Gkaragkounis avatar Sep 09 '22 11:09 Nick-Gkaragkounis

Same bug for me.

nicoszpako avatar Sep 09 '22 15:09 nicoszpako

Same happening here. After checking Proxyman response to the request, it is getting

{
  "status": "ok",
  "status_code": "200"
}

Weird situation

hdem607 avatar Nov 27 '22 14:11 hdem607

Still same for me. it doesn't work

thread = cl.direct_threads(1)[0]
message = cl.direct_messages(thread.id, 1)[0]
print(message)
result = cl.direct_message_delete(message.thread_id, message.id)

nebula0225 avatar Mar 31 '23 13:03 nebula0225

@adw0rd Could you look into this?

cskartikey avatar Apr 14 '23 15:04 cskartikey

@cskartikey send me a PR, I will definitely check it and accept it

adw0rd avatar Apr 14 '23 15:04 adw0rd

@adw0rd Sorry for the delay. Have a look though.

cskartikey avatar May 06 '23 05:05 cskartikey

@cskartikey thanks! Have you checked it?

adw0rd avatar May 06 '23 09:05 adw0rd

@adw0rd Yep, you may close the issue.

cskartikey avatar May 06 '23 17:05 cskartikey