c4.py 文件源码

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

项目:SESTREN 作者: SirThane 项目源码 文件源码
def c4_play(self, ctx, *, user: discord.Member=None):
        """Star a game of Connect Four

        `[p]c4 start @user` will start a game
        with that user in the current channel."""
        if not self.chan_check(ctx):
            return
        if user:
            session = self.session(ctx)
            if session:
                await self.message(ctx, msg="There is already an active game in this channel.", level=2)
            elif user.id == ctx.author.id:
                await self.message(ctx, msg="You cannot start a game with yourself.", level=1)
            elif user.id == self.bot.user.id:
                await self.message(ctx, msg="NOT IMPLEMENTED: You can play against SESTREN soon."
                                            "<:doritoface:337530039677485057>", level=1)
            #     self.sessions[ctx.channel.id] = ConnectFourSession(user, ctx)
            #     await self.send_board(ctx, init=True)
            #     self.sessions[ctx.channel.id].s_play()
            #     await self.send_board(ctx)
            else:
                self.sessions[ctx.channel.id] = ConnectFourSession(user, ctx)
                await self.send_board(ctx, init=True)
        else:
            await self.bot.formatter.format_help_for(ctx, ctx.command, "You need another player to start.")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号