def author_has_role(context: commands.Context, role_id: str) -> bool:
""" Checks within a command's authors roles for one that has a matching ID
to the one given.
:param context: The context in which the command was sent.
:type context: discord.ext.commands.Context
:param role_id: The ID of a role to check for.
:type role_id: str
:return: True if the author has a role with the given ID, false otherwise.
"""
return has_role(context.message.author, role_id)
评论列表
文章目录