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
Adjust original_message deprecation warning #1681
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should they instead use
@property
and not be called inside the function?
Yes. They should either be a property, or an async function. Personally I would prefer a property but I'm open to discussion either way.
# Property
@property
def foo(self):
return bar
# Async function
async def foo(self):
return await bar()
Converted to properties to avoid RuntimeError
`property` is incompatible with the `@deprecated` decorator as properties don't have `__name__`
for more information, see https://pre-commit.ci
On second thought, it might be easier to use async methods instead of properties so that the |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #1681 +/- ##
=======================================
Coverage 33.23% 33.23%
=======================================
Files 95 95
Lines 18423 18423
=======================================
Hits 6123 6123
Misses 12300 12300
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Head branch was pushed to by a user without write access
Fair enough, reverted to async |
This should be released since it fixes a breaking change introduced in 2.2.0 |
Summary
The
original_message
methods inInteraction
were deprecated in 2.2, not 2.1.On another note, the deprecated methods raise a
RuntimeWarning
due to notawait
ing the neworiginal_response
functionsshould they instead use
@property
and not be called inside the function? E.g.ApplicationContext.edit
pycord/discord/commands/context.py
Lines 344 to 347 in 587874c
Information
examples, ...).
Checklist
type: ignore
comments were used, a comment is also left explaining why.