code: def has_role(item):
      
  
      def predicate(ctx):
          if not isinstance(ctx.channel, discord.abc.GuildChannel):
              raise NoPrivateMessage()
  
          if isinstance(item, int):
              role = discord.utils.get(ctx.author.roles, id=item)
          else:
              role = discord.utils.get(ctx.author.roles, name=item)
          if role is None:
              raise MissingRole(item)
          return True
  
      return check(predicate)
docs: A :func:`.check` that is added that checks if the member invoking the
      command has the role specified via the name or ID specified.
  
      If a string is specified, you must give the exact name of the role, including
      caps and spelling.
  
      If an integer is specified, you must give the exact snowflake ID of the role.
  
      If the message is invoked in a private message context then the check will
      return ``False``.
  
      This check raises one of two special exceptions, :exc:`.MissingRole` if the user
      is missing a role, or :exc:`.NoPrivateMessage` if it is used in a private message.
      Both inherit from :exc:`.CheckFailure`.
  
      .. versionchanged:: 1.1.0
  
          Raise :exc:`.MissingRole` or :exc:`.NoPrivateMessage`
          instead of generic :exc:`.CheckFailure`
  
      Parameters
      -----------
      item: Union[:class:`int`, :class:`str`]
          The name or ID of the role to check.