question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature Request: Delete Messages from Inbox

See original GitHub issue

Issue Description

Could we please get the option for deleting a message (PMs) from account inboxes? With something like

r.inbox.messages.delete(‘message_id’).

BACKGROUND: Currently I’m writing a bot that needs to check for unread messages, take action on them and then delete them when they are done. However, the functionality does not seem to be there. nor does there seem to be a read/unread attribute when running

pprint.pprint(vars(message_id))

System Information

PRAW Version: 5.3.0 Python Version: 3.5 Operating System: Linux, ElementaryOS Loki

Possible solution might be to use this code

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
bboecommented, Jan 21, 2018

Oh you asked about testing too. Give a read through these two resources:

Thanks so much for taking a stab at this work. You’re awesome.

2reactions
ghostcommented, Jan 21, 2018

Next Steps

Excuse the write up, I'm trying to make sure I do this right. As they say, Measure twice, cut once.

Step 1: Create a pull request


First I need fork PRAW into a branch that I own, clone that to my computer and then create a PR for master and my forked branch?


Step 2: Make The Method


In praw / models / reddit / message.py create a function in class message underneat def init()

 @classmethod
 def delete(self, reddit):
    self._reddit.post(API_PATH[delete_message], data={'id': self.id} )

Where self is the message object and reddit is the reddit instance. (_reddit.post(…) I believe is basically a POST to the API path defined in the const.py file. )


Step 3: Make the Mapping


In const.py, add the folloing mapping in alphabetical order…

'delete_message': 'r/{subreddit}/api/del_msg',

I believe this is correct because of the delete messages reference in the Reddit API spec

Step 4: Test


I have no idea how to do this, but at this point I need to make sure that the function actually works.

Step 4: Push


Huston, we have my first contribution to open source

Read more comments on GitHub >

github_iconTop Results From Across the Web

More effecient way to delete old messages from inbox
Then they accumulate. In order to delete old messages, I have to open each one, scroll to the bottom, and click “delete message.”...
Read more >
Delete messages from the inbox - Community Feature Request
I think it would be useful to be able to delete messages to the inbox in addition to achieving them.
Read more >
Use Conversation Clean Up to delete redundant messages
Remove redundant messages · On the Home tab, in the Delete group, click Clean Up. · Click one of the following: Clean Up...
Read more >
Wix Inbox Request: Edit or Delete a Message Once It's Sent
Currently in Wix Inbox, you cannot edit or delete a message in a conversation once the message has been sent. We are always...
Read more >
Archive or delete messages, calls, or voicemails - Android
Archive text conversations, calls, or voicemails. You can archive a text conversation, call, or voicemail from your Google Voice inbox without deleting it....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found