infractions.py 文件源码

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

项目:rowboat 作者: b1naryth1ef 项目源码 文件源码
def tempban(self, event, duration, user, reason=None):
        member = event.guild.get_member(user)
        if member:
            self.can_act_on(event, member.id)
            expires_dt = parse_duration(duration)
            Infraction.tempban(self, event, member, reason, expires_dt)
            self.queue_infractions()
            self.confirm_action(event, maybe_string(
                reason,
                u':ok_hand: temp-banned {u} for {t} (`{o}`)',
                u':ok_hand: temp-banned {u} for {t}',
                u=member.user,
                t=humanize.naturaldelta(expires_dt - datetime.utcnow()),
            ))
        else:
            raise CommandFail('invalid user')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号