Skip to content

Conversation

freya022
Copy link
Contributor

Pull Request Etiquette

Changes

  • Internal code
  • Library interface (affecting end-user code)
  • Documentation
  • Other: _____

Closes Issue: #2817

Description

Since Discord now sends recipients of Friend DMs, assumptions on how to detect friend DMs failed, this is now fixed.

Additionally:

  • If the recipient is absent, a warn will be logged and a detached channel will be used
  • Bot DMs from interactions will now target the interaction caller, this should be considered as a fix
  • Detached private channels will now be able to return an User in some situations
  • A new method PrivateChannel#retrieveOpenPrivateChannel() was added, this is intended for cases where the user wants the bot to attempt to send a DM to the friend on which the interaction was called
    • This is necessary as interactions started in friend DMs don't open a channel between the bot and the recipient

- Discord seems to now pass recipients for all private channels
- The User is now accessible in detached channels
As detached channels are still capable of retrieving users, and attempting to open DMs
@Reddishye
Copy link

Awesome! I was just looking for a fork or a pr with this fix (been struggling 30 minutes just to notice it was JDA5 issue)

@freya022 freya022 force-pushed the fix/friend-dm-interactions branch from 8905a41 to 90d7e69 Compare March 27, 2025 16:32
@MinnDevelopment MinnDevelopment added bug type: discord issue seems to be an issue on discord's end labels Mar 27, 2025
@MinnDevelopment MinnDevelopment merged commit d8d6349 into discord-jda:master Mar 27, 2025
1 check passed
@freya022 freya022 deleted the fix/friend-dm-interactions branch March 28, 2025 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug type: discord issue seems to be an issue on discord's end
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants