【发布时间】:2019-04-20 19:54:30
【问题描述】:
如何让我的机器人从服务器中随机选择一个用户,并进行简单的调查或测验?
def survey(self, ctx):
await self.bot.say('CyberLife, the compàny that manufactured me, is conducting a users survey.')
await self.bot.say('Would you like to participate?')
#If user says no...
await self.bot.say("Ok, i'll remind you later.")
#If user says yes...
await self.bot.say("Great. Let's start")
await self.bot.say("Would you consider having a relationship with an android that looks like a human?")
#If user answers anything...
await self.bot.say("Do you think technology could become a threat to mankind?")
#If user answers anything...
await self.bot.say("IF you had to live on a deserted island and could only bring one object,")
await self.bot.say("what would it be?")
#If user answers anything...
await self.bot.say("Do you consider yourself dependent on technology")
#If user answers anything...
await self.bot.say("What technology do you most anticipate?")
#If user answers anything...
await self.bot.say("Do you believe in god?")
#If user answers anything...
await self.bot.say("Would you let an android take care of your children?")
#If user answers anything...
await self.bot.say("How much time per day would you say you spend on an electronic device?")
#If user answers anything...
await self.bot.say("If you needed emergency surgery,")
await self.bot.say("would you agree to be operated on by a machine?")
#If user answers anything...
await self.bot.say("Do you think think one day machines could develop consciousness?")
#If user answers anything...
#End of survey
它会随机触发(每1-2小时),调查会提出问题,用户可以回答任何问题(除了第一个),它会移动到下一个直到它结束。提前感谢您,并对我的菜鸟问题感到抱歉!
【问题讨论】:
标签: python python-3.x python-requests discord discord.py