From f7e5100e5fd7432c949f76426b46928b2dd06f23 Mon Sep 17 00:00:00 2001 From: Wyatt <54227960+WyattRichartz@users.noreply.github.com> Date: Mon, 21 Aug 2023 09:04:42 -0700 Subject: [PATCH] Add option to change global display name (#556) --- discord/user.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/discord/user.py b/discord/user.py index 4704d7358..7bd278363 100644 --- a/discord/user.py +++ b/discord/user.py @@ -776,6 +776,7 @@ class ClientUser(BaseUser): self, *, username: str = MISSING, + global_name: Optional[str] = MISSING, avatar: Optional[bytes] = MISSING, avatar_decoration: Optional[bytes] = MISSING, password: str = MISSING, @@ -812,7 +813,7 @@ class ClientUser(BaseUser): ----------- password: :class:`str` The current password for the client's account. - Required for everything except avatar, banner, accent_colour, date_of_birth, and bio. + Required for everything except avatar, banner, accent_colour, date_of_birth, global_name, and bio. new_password: :class:`str` The new password you wish to change to. email: :class:`str` @@ -857,6 +858,10 @@ class ClientUser(BaseUser): This change cannot be undone and requires you to be in the pomelo rollout. .. versionadded:: 2.1 + global_name: Optional[:class:`str`] + The new global display name you wish to change to. + + .. versionadded:: 2.1 Raises ------ @@ -926,6 +931,9 @@ class ClientUser(BaseUser): if username is not MISSING: args['username'] = username + if global_name is not MISSING: + args['global_name'] = global_name + if discriminator is not MISSING: if self.is_pomelo(): raise ValueError('Discriminator cannot be changed when migrated to pomelo')