Closed scretr closed 4 years ago
solved it, get_pending_thread_requests()
gets pending message requests, not pending messages. my new code:
bot.api.get_inbox_v2()
inbox = bot.last_json
threads = inbox["inbox"]["threads"]
for thread in threads:
if thread["read_state"] == 1:
# do something
else:
# do something else
Code:
Runs fine but after login completed returns this every 10 seconds:
"INFO - There isn't any pending thread request. INFO - User must be at least one."
I'm trying to write a script to automatically reply to any unread Direct messages with a custom message of my choice. I don't understand why
bot.get_pending_thread_requests()
isn't returning the right threads. I've tested this with and without unread messages in the inbox and I've still had the same response.