-
Notifications
You must be signed in to change notification settings - Fork 140
refactor(appinfo)!: improve application models #695
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
base: master
Are you sure you want to change the base?
Conversation
no functional changes
@@ -1974,7 +1974,7 @@ async def fetch_widget(self, guild_id: int, /) -> Widget: | |||
data = await self.http.get_widget(guild_id) | |||
return Widget(state=self._connection, data=data) | |||
|
|||
async def application_info(self) -> AppInfo: | |||
async def application_info(self) -> BotAppInfo: |
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.
Might it be worth caching this information? IIRC we receive the full app info on on_ready/identify when we receive the flags of the application. If not, it may be worth caching this information anyways (due to the ext.commands extension using it anyways, and this information being quite useful regardless)
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.
Caching this should be up to users, since the data could change at any time - ext.commands
already caches the owner/owners, which is the only part it currently needs, and the ready
event only contains app ID + flags :/
d16e21f
to
53aaf1b
Compare
53aaf1b
to
0f0a89b
Compare
@shiftinv would you please resolve conflicts? |
@onerandomusername done. |
@shiftinv would you please resolve conflicts again? |
c5c888a
to
fb557cb
Compare
Summary
Refactors application models, deduplicating and generally merging related code.
The diff is fairly unreadable as-is, skipping the first commit (that just moves
PartialAppInfo
aboveAppInfo
) improves readability quite a bit.tl;dr on the important changes, see changelog for everything:
PartialAppInfo < AppInfo < BotAppInfo
(whereBotAppInfo
is equivalent to the oldAppInfo
)AppInfo.summary
is no more (deprecated in previous version)Invite.target_application
(which is nowAppInfo
) contains more fieldscover_image
url formatChecklist
task lint
task pyright