fix: remove internal use of deprecated role type methods#3167
fix: remove internal use of deprecated role type methods#3167Revnoplex wants to merge 5 commits intoPycord-Development:masterfrom
Conversation
|
Thanks for opening this pull request! This pull request can be checked-out with: git fetch origin pull/3167/head:pr-3167
git checkout pr-3167This pull request can be installed with: pip install git+https://github.com/Pycord-Development/pycord@refs/pull/3167/head |
…ated-method-use' into fix/internal-deprecated-method-use
|
My fault... |
|
I'm assuming I need a changelog entry this time as theres an entry for 2.8.0rc1 and the problem was introduced before this |
|
Should use |
Paillat-dev
left a comment
There was a problem hiding this comment.
Yes needs a changelog as well.
Also please hold till I take a better look
| .. versionadded:: 1.6 | ||
| """ | ||
| return self.tags is not None and self.tags.is_bot_managed() |
There was a problem hiding this comment.
This one and the next 4 can use self.type instead of self.tags.type. Removes the need for an is not None check too.
Or alternatively use self.tags.method.__wrapped__() which would ensure the actual deprecated tags method is called to have truly the same code run as before deprecation.
There was a problem hiding this comment.
how would I use self.tags.method.__wrapped__()?
There was a problem hiding this comment.
For example in this case it would be
return self.tags is not None and self.tags.is_bot_managed.__wrapped__() But I am not sure we wanna do this. Waiting to see what the others think
There was a problem hiding this comment.
I mean return self.type is RoleType.TYPE does look cleaner
There was a problem hiding this comment.
The point is that if for some reason self.type is broken / incorrect, the "old deprecated" implementation would not break without notice. Extra safety.
There was a problem hiding this comment.
So I should wait for this to be reviewed
|
wdym hold changelog, I added it. Unless I need to modify it or add another entry |
Didn't refresh on my end |
Caution
Feature freeze is active, as described by our Release Schedule.
Summary
#2708 deprecated the use of certain role type methods (eg. Role.is_premium_subscriber) in favour of the
RoleTypeenum. Now I found the library throwing several deprecation warnings when firing theon_guild_updateevent and upon tracing the lines the warnings were emitted from found several uses of the old methods. This pr replaces the found internal usage of these old methods.Information
examples, ...).
Checklist
type: ignorecomments were used, a comment is also left explaining why.