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)
评论列表
文章目录