code: async def create_custom_emoji(self, *, name, image, roles=None, reason=None):
          r
  
          img = utils._bytes_to_base64_data(image)
          if roles:
              roles = [role.id for role in roles]
          data = await self._state.http.create_custom_emoji(self.id, name, img, roles=roles, reason=reason)
          return self._state.store_emoji(self, data)
docs: r"""|coro|
  
          Creates a custom :class:`Emoji` for the guild.
  
          There is currently a limit of 50 static and animated emojis respectively per guild,
          unless the guild has the ``MORE_EMOJI`` feature which extends the limit to 200.
  
          You must have the :attr:`~Permissions.manage_emojis` permission to
          do this.
  
          Parameters
          -----------
          name: :class:`str`
              The emoji name. Must be at least 2 characters.
          image: :class:`bytes`
              The :term:`py:bytes-like object` representing the image data to use.
              Only JPG, PNG and GIF images are supported.
          roles: Optional[List[:class:`Role`]]
              A :class:`list` of :class:`Role`\s that can use this emoji. Leave empty to make it available to everyone.
          reason: Optional[:class:`str`]
              The reason for creating this emoji. Shows up on the audit log.
  
          Raises
          -------
          Forbidden
              You are not allowed to create emojis.
          HTTPException
              An error occurred creating an emoji.
  
          Returns
          --------
          :class:`Emoji`
              The created emoji.