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

feat: implement (Sync)WebhookMessage.thread #2314

Closed
wants to merge 17 commits into from
Closed

feat: implement (Sync)WebhookMessage.thread #2314

wants to merge 17 commits into from

Conversation

Def-Try
Copy link

@Def-Try Def-Try commented Jan 8, 2024

Summary

Related to issue #2298
Fixes webhook messages assuming that their _thread_id can not be None (spoiler; it can)

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.

Signed-off-by: CommandLine <[email protected]>
Lulalaby
Lulalaby previously approved these changes Jan 8, 2024
@Def-Try Def-Try changed the title Fix WebhookMessage.edit and WebhookMessage.delete assuming that their _thread_id can not be None fix: WebhookMessage.edit and WebhookMessage.delete assuming that their _thread_id can not be None Jan 8, 2024
@Lulalaby Lulalaby requested review from Dorukyum and removed request for ChickenDevs and VincentRPS January 8, 2024 15:04
@Lulalaby Lulalaby added the bug Something isn't working label Jan 8, 2024
@Lulalaby Lulalaby enabled auto-merge (squash) January 8, 2024 15:04
@Dorukyum Dorukyum changed the title fix: WebhookMessage.edit and WebhookMessage.delete assuming that their _thread_id can not be None fix: Object created with None id Jan 13, 2024
@Dorukyum
Copy link
Member

Your changes might fix the issue but I think the best way to approach this is to create a property called WebhookMessage.thread_id instead. That would get rid of the duplicate code. What do you think?

@Lulalaby
Copy link
Member

I agree with doru

Signed-off-by: CommandLine <[email protected]>
auto-merge was automatically disabled January 15, 2024 15:05

Head branch was pushed to by a user without write access

Signed-off-by: CommandLine <[email protected]>
@Def-Try
Copy link
Author

Def-Try commented Jan 15, 2024

Wait, i read comment wrong...

@Lulalaby Lulalaby self-requested a review January 15, 2024 15:08
@Def-Try
Copy link
Author

Def-Try commented Jan 15, 2024

so, something like that? never worked on big projects (and typing to be honest), so my style may be weird

@Def-Try
Copy link
Author

Def-Try commented Jan 15, 2024

i do not know why docs/readthedocs.org:pycord check keeps failing
everything else on the other hand appears to be ok
image
image
image

@Lulalaby
Copy link
Member

@Def-Try
Copy link
Author

Def-Try commented Jan 15, 2024

https://readthedocs.org/projects/pycord/builds/23121803/ look here

all i see here is an AttributeError: None with no information about what caused it (in pycord code i mean) and a lot of warnings

@Dorukyum Dorukyum linked an issue Jan 24, 2024 that may be closed by this pull request
3 tasks
@Dorukyum Dorukyum added priority: high High Priority status: in progress Work in Progess labels Jan 24, 2024
@Dorukyum
Copy link
Member

I went ahead and replaced your solution with adding WebhookMessage.thread and SyncWebhookMessage.thread properties. Not sure if this is necessary or if this is the best solution, but it's the cleanest solution that came to my mind.

Requires testing.

@Dorukyum Dorukyum changed the title fix: Object created with None id feat: implement (Sync)WebhookMessage.thread Jan 25, 2024
@Dorukyum
Copy link
Member

Dorukyum commented Feb 1, 2024

After looking with a clear mind into the issue I realized none of these changes were necessary. Will open a new pr with just 2 lines changed. Thanks nevertheless.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority: high High Priority status: in progress Work in Progess
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TypeError when editing a fetched message from a partial webhook
3 participants