async def draw_ls(self, ctx: commands.Command, *argv): if not KujiUtil.canDrawLs(ctx.author.id): await ctx.reply("親愛的員工, 你今天已經抽過龍山寺籤了哦! 每人一天只限一次.") return if not await self.checkToken(ctx): return random.seed(random.random()) index = random.randint(0, 98) ls = LUNGSHAN[index] status = ls["status"] img = File(KujiUtil.getImageUrlLs(status), filename=KujiUtil.getImageNameLs(status)) await ctx.reply(file=img, embed=KujiEmbed.createEmbededLs( ls, datetime.now(), f"{self.bot.user.name} - 抽籤遊戲")) KujiUtil.updateMemberLs(ctx.author.id, index)
def test_canDraw_false(self): KujiUtil.updateMemberJp(1, 1) KujiUtil.updateMemberCn(1, 0, 0) KujiUtil.updateMemberLs(1, 1) assert not KujiUtil.canDrawLs(1)
def test_canDrawLs_false(self): KujiUtil.updateMemberLs(1, 1) assert not KujiUtil.canDrawLs(1)
def test_canDraw_true(self): assert KujiUtil.canDrawJp(1) assert KujiUtil.canDrawCn(1) assert KujiUtil.canDrawLs(1)