Add User.system and MessageFlags.urgent
This commit is contained in:
		| @@ -215,3 +215,11 @@ class MessageFlags(BaseFlags): | |||||||
|     def source_message_deleted(self): |     def source_message_deleted(self): | ||||||
|         """:class:`bool`: Returns ``True`` if the source message for this crosspost has been deleted.""" |         """:class:`bool`: Returns ``True`` if the source message for this crosspost has been deleted.""" | ||||||
|         return 8 |         return 8 | ||||||
|  |  | ||||||
|  |     @flag_value | ||||||
|  |     def urgent(self): | ||||||
|  |         """:class:`bool`: Returns ``True`` if the source message is an urgent message. | ||||||
|  |  | ||||||
|  |         An urgent message is one sent by Discord Trust and Safety. | ||||||
|  |         """ | ||||||
|  |         return 16 | ||||||
|   | |||||||
| @@ -74,7 +74,7 @@ class Profile(namedtuple('Profile', 'flags user mutual_guilds connected_accounts | |||||||
| _BaseUser = discord.abc.User | _BaseUser = discord.abc.User | ||||||
|  |  | ||||||
| class BaseUser(_BaseUser): | class BaseUser(_BaseUser): | ||||||
|     __slots__ = ('name', 'id', 'discriminator', 'avatar', 'bot', '_state') |     __slots__ = ('name', 'id', 'discriminator', 'avatar', 'bot', 'system', '_state') | ||||||
|  |  | ||||||
|     def __init__(self, *, state, data): |     def __init__(self, *, state, data): | ||||||
|         self._state = state |         self._state = state | ||||||
| @@ -98,6 +98,7 @@ class BaseUser(_BaseUser): | |||||||
|         self.discriminator = data['discriminator'] |         self.discriminator = data['discriminator'] | ||||||
|         self.avatar = data['avatar'] |         self.avatar = data['avatar'] | ||||||
|         self.bot = data.get('bot', False) |         self.bot = data.get('bot', False) | ||||||
|  |         self.system = data.get('system', False) | ||||||
|  |  | ||||||
|     @classmethod |     @classmethod | ||||||
|     def _copy(cls, user): |     def _copy(cls, user): | ||||||
| @@ -290,6 +291,8 @@ class ClientUser(BaseUser): | |||||||
|         The avatar hash the user has. Could be None. |         The avatar hash the user has. Could be None. | ||||||
|     bot: :class:`bool` |     bot: :class:`bool` | ||||||
|         Specifies if the user is a bot account. |         Specifies if the user is a bot account. | ||||||
|  |     system: :class:`bool` | ||||||
|  |         Specifies if the user is a system user (i.e. represents Discord officially). | ||||||
|     verified: :class:`bool` |     verified: :class:`bool` | ||||||
|         Specifies if the user is a verified account. |         Specifies if the user is a verified account. | ||||||
|     email: Optional[:class:`str`] |     email: Optional[:class:`str`] | ||||||
| @@ -658,6 +661,8 @@ class User(BaseUser, discord.abc.Messageable): | |||||||
|         The avatar hash the user has. Could be None. |         The avatar hash the user has. Could be None. | ||||||
|     bot: :class:`bool` |     bot: :class:`bool` | ||||||
|         Specifies if the user is a bot account. |         Specifies if the user is a bot account. | ||||||
|  |     system: :class:`bool` | ||||||
|  |         Specifies if the user is a system user (i.e. represents Discord officially). | ||||||
|     """ |     """ | ||||||
|  |  | ||||||
|     __slots__ = BaseUser.__slots__ + ('__weakref__',) |     __slots__ = BaseUser.__slots__ + ('__weakref__',) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user