Skip to content

fix: is_owner() user type hint#2593

Merged
Lulalaby merged 2 commits intoPycord-Development:masterfrom
controlado:patch-1
Sep 30, 2024
Merged

fix: is_owner() user type hint#2593
Lulalaby merged 2 commits intoPycord-Development:masterfrom
controlado:patch-1

Conversation

@controlado
Copy link
Contributor

@controlado controlado commented Sep 30, 2024

Summary

The user parameter must accept both a User and a Member, as the docstring itself says. In practice, it solves this error: Argument 1 to "is_owner" of "BotBase" has incompatible type "User | Member"; expected "User"mypyarg-type.

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.

The `user` parameter must accept both a `User` and a `Member`, as the docstring itself says.

Signed-off-by: balaclava <71716568+controlado@users.noreply.github.com>
Signed-off-by: balaclava <71716568+controlado@users.noreply.github.com>
@controlado controlado changed the title fix(is_owner) user type hint fix: is_owner() user type hint Sep 30, 2024
@controlado controlado marked this pull request as ready for review September 30, 2024 03:03
@controlado controlado requested a review from a team as a code owner September 30, 2024 03:03
@pullapprove4 pullapprove4 bot requested a review from plun1331 September 30, 2024 03:03
@Lulalaby Lulalaby merged commit c430fbb into Pycord-Development:master Sep 30, 2024
NeloBlivion added a commit to NeloBlivion/pycord that referenced this pull request Oct 4, 2024
baribarton pushed a commit to baribarton/pycord-no-potential-reconnect that referenced this pull request Oct 24, 2024
* fix(is_owner) `user` type hint

The `user` parameter must accept both a `User` and a `Member`, as the docstring itself says.

Signed-off-by: balaclava <71716568+controlado@users.noreply.github.com>

* Update CHANGELOG.md

Signed-off-by: balaclava <71716568+controlado@users.noreply.github.com>

---------

Signed-off-by: balaclava <71716568+controlado@users.noreply.github.com>
OmLanke pushed a commit to OmLanke/pycord that referenced this pull request Dec 16, 2024
* fix(is_owner) `user` type hint

The `user` parameter must accept both a `User` and a `Member`, as the docstring itself says.

Signed-off-by: balaclava <71716568+controlado@users.noreply.github.com>

* Update CHANGELOG.md

Signed-off-by: balaclava <71716568+controlado@users.noreply.github.com>

---------

Signed-off-by: balaclava <71716568+controlado@users.noreply.github.com>
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.

3 participants