Esempio n. 1
0
    def test_clearData(self):
        KujiUtil.updateMemberJp(1, 1)
        KujiUtil.clearData()
        assert KujiUtil.canDrawJp(1)

        KujiUtil.updateMemberCn(1, 1, 2)
        assert not KujiUtil.canDrawCn(1)
Esempio n. 2
0
 async def draw_cn(self, ctx: commands.Command, *argv):
     if not KujiUtil.canDrawCn(ctx.author.id):
         await ctx.reply("親愛的員工, 你今天已經抽過易經了哦! 每人一天只限一次.")
         return
     if not await self.checkToken(ctx):
         return
     random.seed(random.random())
     yiIndex = KujiUtil.getYi()
     yi = KujiUtil.getTargetedYi(yiIndex[0], yiIndex[1])
     await ctx.reply(embed=KujiEmbed.createEmbededCn(
         yi, datetime.now(), f"{self.bot.user.name} - 抽籤遊戲"))
     KujiUtil.updateMemberCn(ctx.author.id, yiIndex[0], yiIndex[1])
Esempio n. 3
0
    def test_getHistoryCn(self):
        KujiUtil.updateMemberCn(1, 1, 2)
        history = KujiUtil.getHistoryCn(1)

        assert history[0] == 1
        assert history[1] == 2
Esempio n. 4
0
 def test_canDraw_false(self):
     KujiUtil.updateMemberJp(1, 1)
     KujiUtil.updateMemberCn(1, 0, 0)
     KujiUtil.updateMemberLs(1, 1)
     assert not KujiUtil.canDrawLs(1)
Esempio n. 5
0
 def test_canDrawCn_false(self):
     KujiUtil.updateMemberCn(1, 0, 0)
     assert not KujiUtil.canDrawCn(1)