modlog.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:dogbot 作者: slice 项目源码 文件源码
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)}'
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号