@@ -422,31 +422,41 @@ def _update(self, data: UserPayload) -> None:
422422
423423 # TODO: Username might not be able to edit anymore.
424424 async def edit (
425- self , * , username : str = MISSING , avatar : bytes = MISSING
425+ self ,
426+ * ,
427+ username : str = MISSING ,
428+ avatar : bytes = MISSING ,
429+ banner : bytes = MISSING ,
426430 ) -> ClientUser :
427431 """|coro|
428432
429433 Edits the current profile of the client.
430434
431435 .. note::
432436
433- To upload an avatar, a :term:`py:bytes-like object` must be passed in that
437+ To upload an avatar or banner , a :term:`py:bytes-like object` must be passed in that
434438 represents the image being uploaded. If this is done through a file
435439 then the file must be opened via ``open('some_filename', 'rb')`` and
436440 the :term:`py:bytes-like object` is given through the use of ``fp.read()``.
437441
438- The only image formats supported for uploading is JPEG and PNG .
442+ The only image formats supported for uploading are JPEG, PNG, and GIF .
439443
440444 .. versionchanged:: 2.0
441445 The edit is no longer in-place, instead the newly edited client user is returned.
442446
447+ .. versionchanged:: 2.6
448+ The ``banner`` keyword-only parameter was added.
449+
443450 Parameters
444451 ----------
445452 username: :class:`str`
446453 The new username you wish to change to.
447454 avatar: :class:`bytes`
448455 A :term:`py:bytes-like object` representing the image to upload.
449456 Could be ``None`` to denote no avatar.
457+ banner: :class:`bytes`
458+ A :term:`py:bytes-like object` representing the image to upload.
459+ Could be ``None`` to denote no banner.
450460
451461 Returns
452462 -------
@@ -458,7 +468,7 @@ async def edit(
458468 HTTPException
459469 Editing your profile failed.
460470 InvalidArgument
461- Wrong image format passed for ``avatar``.
471+ Wrong image format passed for ``avatar`` or ``banner`` .
462472 """
463473 payload : dict [str , Any ] = {}
464474 if username is not MISSING :
@@ -469,6 +479,11 @@ async def edit(
469479 elif avatar is not MISSING :
470480 payload ["avatar" ] = _bytes_to_base64_data (avatar )
471481
482+ if banner is None :
483+ payload ["banner" ] = None
484+ elif banner is not MISSING :
485+ payload ["banner" ] = _bytes_to_base64_data (banner )
486+
472487 data : UserPayload = await self ._state .http .edit_profile (payload )
473488 return ClientUser (state = self ._state , data = data )
474489
0 commit comments