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.

Raise error when User doesn't accept DM

See original GitHub issue

Summary

Raise an error if the user we try to send a message to doesn’t accepts direct messages

What is the feature request for?

The core library

The Problem

Currently, there is no way to know if a user will receive a message when we send one. And moreover, sending a message to someone not accepting it, blocks the execution flow and stops the function

The Ideal Solution

The user.send and member.send functions should raise an Error such as the Forbidden error. So that we know if the execution failed. We would only need to catch this error and then adapt our code.

The Current Solution

Currently there is none since it seems sending this kind of DM completely blocks the execution flow

Additional Context

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
CL0Pinettecommented, Aug 2, 2022

I found where it was changed : 0546343bcb138b71ca1f16a5ae10893efeac651c I apologize for creating this issue

0reactions
CL0Pinettecommented, Aug 2, 2022

hmm, looks like updating fixed it, but I don’t see any commit that could have changed this behaviour…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error message "User doesn't accept direct messages ... - Reddit
A user just told me they are getting the error message "User doesn't accept direct messages. Try sending a chat request instead.
Read more >
discord bot failing to send direct message, upon kicking ...
While testing: The kicked users DMs were open; the bot had admin privileges. The console gives out this error: discord.ext.commands.
Read more >
Instagram won't let me send a message to one person. It says ...
If I have a DM conversation on Instagram and the other person unfollows me, but doesn't block me, will they still be able...
Read more >
It looks like the account-limits of "POST direct_messages ...
The issue I want to report is: I received a message from a user, but the message doesn't reset 24 hour window and...
Read more >
Error Handling in Discord.py | Part 5 - YouTube
In this video, we will learn how to handle errors in our bot coded in python using discord.py v1.0.1 (rewrite) in 2020.
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