Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: DMChannel.recipient and User.dm_channel being None after calling User.create_dm #2219

Merged
merged 4 commits into from
Aug 29, 2023

Conversation

davidhozic
Copy link
Contributor

@davidhozic davidhozic commented Aug 29, 2023

Summary

In the current version (v2.5.0.rc5) the User.dm_channel is None even after calling User.create_dm.
It is due to a recipient not being assigned to DMChannel.recipient.

import discord
import secret

client = discord.Client()

@client.event
async def on_ready():
    zajcek_user = await client.get_or_fetch_user(145196308985020416)
    print(zajcek_user.dm_channel)
    await zajcek_user.create_dm()
    print(zajcek_user.dm_channel)

    await client.close()

client.run(secret.TOKEN)

Information

  • This PR fixes an issue.
  • This PR adds something new (e.g. new method or parameters).
  • This PR is a breaking change (e.g. methods or parameters removed/renamed).
  • This PR is not a code change (e.g. documentation, README, typehinting,
    examples, ...).

Checklist

  • I have searched the open pull requests for duplicates.
  • If code changes were made then they have been tested.
    • I have updated the documentation to reflect the changes.
  • If type: ignore comments were used, a comment is also left explaining why.
  • I have updated the changelog to include these changes.

@Lulalaby
Copy link
Member

the current version is rc5 btw

@davidhozic
Copy link
Contributor Author

the current version is rc5 btw

Oh sorry yeah, I am on rc5 actually.. just miswrote :D.

@davidhozic davidhozic marked this pull request as ready for review August 29, 2023 12:03
@davidhozic davidhozic requested a review from a team as a code owner August 29, 2023 12:03
@Lulalaby Lulalaby enabled auto-merge (squash) August 29, 2023 12:03
@Lulalaby Lulalaby merged commit 402f2bd into Pycord-Development:master Aug 29, 2023
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants