-
Notifications
You must be signed in to change notification settings - Fork 148
feat: Guest invites #1062
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?
feat: Guest invites #1062
Changes from 3 commits
ef17933
0a7b40c
314990a
f3af2c1
d7f5150
10d55b9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Implement Guest invites. | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -7,6 +7,7 @@ | |||||
| from .appinfo import PartialAppInfo | ||||||
| from .asset import Asset | ||||||
| from .enums import ChannelType, InviteTarget, NSFWLevel, VerificationLevel, try_enum | ||||||
| from .flags import InviteFlags | ||||||
| from .guild_scheduled_event import GuildScheduledEvent | ||||||
| from .mixins import Hashable | ||||||
| from .object import Object | ||||||
|
|
@@ -398,6 +399,7 @@ class Invite(Hashable): | |||||
| "guild_scheduled_event", | ||||||
| "guild_welcome_screen", | ||||||
| "_state", | ||||||
| "_flags", | ||||||
| ) | ||||||
|
|
||||||
| BASE = "https://discord.gg" | ||||||
|
|
@@ -466,6 +468,8 @@ def __init__( | |||||
| else: | ||||||
| self.guild_scheduled_event: Optional[GuildScheduledEvent] = None | ||||||
|
|
||||||
| self._flags: int = data.get("flags", 0) | ||||||
|
|
||||||
| @classmethod | ||||||
| def from_incomplete(cls, *, state: ConnectionState, data: InvitePayload) -> Self: | ||||||
| guild: Optional[Union[Guild, PartialInviteGuild]] | ||||||
|
|
@@ -565,6 +569,14 @@ def url(self) -> str: | |||||
| url += f"?event={self.guild_scheduled_event.id}" | ||||||
| return url | ||||||
|
|
||||||
| @property | ||||||
| def flags(self) -> InviteFlags: | ||||||
| """:class:`InviteFlags`: Invite's flags. | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| .. versionadded:: 2.10 | ||||||
| """ | ||||||
| return InviteFlags._from_value(self._flags) | ||||||
|
|
||||||
| async def delete(self, *, reason: Optional[str] = None) -> None: | ||||||
| """|coro| | ||||||
|
|
||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -716,6 +716,16 @@ def flags(self) -> MemberFlags: | |
| """ | ||
| return MemberFlags._from_value(self._flags) | ||
|
|
||
| def is_guest(self) -> bool: | ||
| """Whether this member joined the guild as a guest (i.e., via a guest invite). | ||
elenakrittik marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| Returns | ||
| ------- | ||
| :class:`bool` | ||
| Whether the member is a guest. | ||
| """ | ||
| return self.joined_at is None | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's also a new member flag, |
||
|
|
||
| @overload | ||
| async def ban( | ||
| self, | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.