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: Add helper methods to determine interactions integrations #2659

Merged

Conversation

DA-344
Copy link
Contributor

@DA-344 DA-344 commented Nov 28, 2024

Summary

Adds Interaction.is_guild_integration and Interaction.is_user_integration to easily check whether an interaction has been invoked by a guild or user integration.

Also adds this to ApplicationContext.

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
Lulalaby previously approved these changes Nov 28, 2024
Copy link
Member

@Lulalaby Lulalaby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good addition! 💕🎉

@Lulalaby Lulalaby enabled auto-merge (squash) November 28, 2024 16:03
@Lulalaby Lulalaby requested review from plun1331 and JustaSqu1d and removed request for VincentRPS November 28, 2024 16:03
@Lulalaby Lulalaby added the feature Implements a feature label Nov 28, 2024
@Lulalaby Lulalaby added this to the v2.7 milestone Nov 28, 2024
Copy link
Contributor

@Paillat-dev Paillat-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Member

@JustaSqu1d JustaSqu1d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor convention and grammar

discord/commands/context.py Outdated Show resolved Hide resolved
discord/interactions.py Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
Co-authored-by: JustaSqu1d <[email protected]>
Signed-off-by: DA344 <[email protected]>
auto-merge was automatically disabled December 10, 2024 07:44

Head branch was pushed to by a user without write access

@JustaSqu1d JustaSqu1d requested a review from Lulalaby December 10, 2024 07:44
DA-344 and others added 2 commits December 10, 2024 08:46
Co-authored-by: JustaSqu1d <[email protected]>
Signed-off-by: DA344 <[email protected]>
Co-authored-by: JustaSqu1d <[email protected]>
Signed-off-by: DA344 <[email protected]>
Copy link
Member

@JustaSqu1d JustaSqu1d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't quite like the naming. Interactions aren't exactly integrations.

Could we change it from is_x_integration to is_x_authorized?

Or if you have a better name that we could go with.

@DA-344
Copy link
Contributor Author

DA-344 commented Dec 15, 2024

I don't quite like the naming. Interactions aren't exactly integrations.

Yeah, but when invoking an application command, you are using an integration, which can either be guild or user installed.

Could we change it from is_x_integration to is_x_authorized?

Or if you have a better name that we could go with.

I think the current naming is nice, but if it is really neccesary I can change it to is_x_authorized.

@Paillat-dev
Copy link
Contributor

I feel like both namings make sense, maybe is_x_authorized is more explicit since that is in fact what is being checked.

dependabot bot and others added 2 commits December 21, 2024 00:44
…ycord-Development#2676)

Updates the requirements on [mypy](https://github.com/python/mypy) to permit the latest version.
- [Changelog](https://github.com/python/mypy/blob/master/CHANGELOG.md)
- [Commits](python/mypy@v1.13.0...v1.14.0)

---
updated-dependencies:
- dependency-name: mypy
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
CHANGELOG.md Outdated Show resolved Hide resolved
Signed-off-by: plun1331 <[email protected]>
@plun1331 plun1331 enabled auto-merge (squash) December 26, 2024 18:26
plun1331
plun1331 previously approved these changes Dec 26, 2024
Copy link
Member

@JustaSqu1d JustaSqu1d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason changelog is en-US.

CHANGELOG.md Outdated Show resolved Hide resolved
auto-merge was automatically disabled December 27, 2024 08:41

Head branch was pushed to by a user without write access

Copy link
Member

@Lulalaby Lulalaby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we really should stop doing american / british english

@Lulalaby Lulalaby merged commit 9fa5cbe into Pycord-Development:master Dec 27, 2024
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Implements a feature
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

6 participants