def format_member_departure(self, member: discord.Member, *, verb: str = 'left', emoji: str ='\N{OUTBOX TRAY}') -> str:
"""
Formats a member's departure from the server. Can be customized.
This function automatically adds the basketball emoji before the member's description if the joined recently.
If the provided member is a ``discord.User``, the joined and basketball emoji are always omitted.
Account creation information is always shown.
:param member: The member who left.
:param verb: The verb to append right after the name. For example, providing "was banned" will format the
departure as "User#1234 was banned [...]"
:param emoji: The emoji to place before the user's description.
:return: The formatted departure.
"""
# if it's a user, return bare info
if isinstance(member, discord.User):
return f'{emoji} {describe(member, before=verb, created=True)}'
# did they bounce?
bounce = '\U0001f3c0 ' if (datetime.datetime.utcnow() - member.joined_at).total_seconds() <= 1500 else ''
return f'{emoji} {bounce}{describe(member, before=verb, created=True, joined=True)}'
评论列表
文章目录