survey.py 文件源码

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

项目:tmerc-cogs 作者: tmercswims 项目源码 文件源码
def _changeanswer(self, ctx: commands.Context,
                            survey_id: str):
        """Changes the calling user's response for the given survey."""
        user = ctx.message.author
        server_id = self._get_server_id_from_survey_id(survey_id)

        if survey_id in self.surveys["closed"]:
            await self.bot.send_message(user,
                                        cf.error("That survey is closed."))
            return

        if not server_id:
            await self.bot.send_message(user, cf.error(
                "Survey with ID {} not found.".format(survey_id)))
            return

        new_task = self.bot.loop.create_task(
            self._send_message_and_wait_for_message(server_id,
                                                    survey_id, user,
                                                    change=True))
        self.tasks[survey_id].append(new_task)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号