Beispiel #1
0
    async def set_bonus(self, membership):
        await self.ctx.send(_("What is the bonus payout multiplier for this membership?\n"
                              "*Defaults to one*"))
        bonus = await self.ctx.bot.wait_for("message", timeout=25.0,
                                            check=MessagePredicate.valid_float(ctx=self.ctx))

        if bonus.content.lower() == self.cancel:
            raise ExitProcess

        if self.mode == 'create':
            membership['Bonus'] = float(bonus.content)
            return

        async with self.coro() as membership_data:
            membership_data[membership]['Bonus'] = float(bonus.content)

        await self.ctx.send(_("Bonus multiplier set to {}.").format(bonus.content))