-
-
Notifications
You must be signed in to change notification settings - Fork 93
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
Implement Stage Instances #1725
base: master
Are you sure you want to change the base?
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
8425260
to
fb4e40d
Compare
discord/discord-api-docs#5687 was merged last night so I'm gonna keep this as a draft until I get a moment to add this in. I have it committed locally but haven't had the chance to test yet. |
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.
Thanks for taking over this PR!
cbaa523
to
683f9dd
Compare
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.
LGTM, just a nitpick :)
add stubs fix linting make names more consistent. started adding tests change stage_id to id rename stage_instance_events to stage_events. add helpful functions and modify abc thing rename and fix linting fix bugs + add tests for event manager add tests for stage events and fix some bugs add tests for stage_instance fix linting add tests and fix small bugs
Just brought it up to date with the current version (at time of writing)
`guild_scheduled_event_id` was recently merged into DAPI docs. `send_start_notification` was added to Create Stage Instance some time ago, so I added that in too.
Co-authored-by: davfsa <davfsa@gmail.com> Signed-off-by: nulldomain <git@nulldoma.in>
Co-authored-by: davfsa <davfsa@gmail.com> Signed-off-by: nulldomain <git@nulldoma.in>
7ee021d
to
e2f4b43
Compare
Co-authored-by: davfsa <davfsa@gmail.com> Signed-off-by: nulldomain <git@nulldoma.in>
Co-authored-by: davfsa <davfsa@gmail.com> Signed-off-by: nulldomain <git@nulldoma.in>
Co-authored-by: davfsa <davfsa@gmail.com> Signed-off-by: nulldomain <git@nulldoma.in>
@FasterSpeeding please review when you can :) |
@FasterSpeeding Can you review please? |
|
||
@property | ||
@abc.abstractmethod | ||
def stage_instance_id(self) -> snowflakes.Snowflake: |
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.
This is a small thing but this property could just be a solid implementation which returns self.stage_instance.id
, there's not really any good reason for it to be abstract since it's the same implementation each time.
@property | ||
def app(self) -> traits.RESTAware: | ||
# <<inherited docstring from Event>>. | ||
return self.stage_instance.app |
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.
These app property implementations could be moved to StageInstanceEvent since it's the same implementation each time anyways
guild_scheduled_event_id = ( | ||
snowflakes.Snowflake(payload["guild_scheduled_event_id"]) if payload["guild_scheduled_event_id"] else None | ||
) |
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.
guild_scheduled_event_id = ( | |
snowflakes.Snowflake(payload["guild_scheduled_event_id"]) if payload["guild_scheduled_event_id"] else None | |
) | |
raw_event_id = payload["guild_scheduled_event_id"] | |
guild_scheduled_event_id = snowflakes.Snowflake(raw_event_id) if raw_event_id else None |
Would make this a bit cleaner
Returns | ||
------- | ||
hikari.channels.GuildStageChannel | ||
The guild stage channel where this stage instance was created. |
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.
The Returns section here needs to be updated to reflect that the return type is optional
Asides from those few small things LGTM |
# -*- coding: utf-8 -*- | ||
# cython: language_level=3 | ||
# Copyright (c) 2020 Nekokatt | ||
# Copyright (c) 2021 davfsa |
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.
# Copyright (c) 2021 davfsa | |
# Copyright (c) 2021-present davfsa |
# -*- coding: utf-8 -*- | ||
# cython: language_level=3 | ||
# Copyright (c) 2020 Nekokatt | ||
# Copyright (c) 2021 davfsa |
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.
# Copyright (c) 2021 davfsa | |
# Copyright (c) 2021-present davfsa |
Summary
This PR aims to finish the work made by @ashwinvin in #695, including rebasing on the most recent hikari version (at the time of writing) and bringing tests up to scratch.
Hopefully I haven't missed anything, I only had a few hours to look at this.
Checklist
nox
and all the pipelines have passed.Related issues
Closes #695
Closes #602