【发布时间】:2021-02-28 19:53:24
【问题描述】:
如何制作我的代码,以便它选择 1/4 可能的答案作为答案,并且当不和谐用户对正确答案或错误答案做出反应时,它会返回获胜或失败的答案。 我也希望每次的答案都是随机的。
class games(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.command()
async def findimposter(self, ctx):
embed1 = discord.Embed(title = "Who's the imposter?" , description = "Find out who the imposter is before the reactor breaks down!" , color=0xff0000)
embed1.add_field(name = 'Red' , value= '<:redcrewmates:776867415514153031>' , inline=False)
embed1.add_field(name = 'Blue' , value= '<:bluecrewmates:776867439085617153>' , inline=False)
embed1.add_field(name = 'Lime' , value= '<:limecrewmates:776867489866711041>' , inline=False)
embed1.add_field(name = 'White' , value= '<:whitecrewmates:776867529900425217>' , inline=False)
msg1 = await ctx.send(embed=embed1)
redcrew = '<:redcrewmates:776867415514153031>'
bluecrew = '<:bluecrewmates:776867439085617153>'
limecrew = '<:limecrewmates:776867489866711041>'
whitecrew = '<:whitecrewmates:776867529900425217>'
await msg1.add_reaction(redcrew)
await msg1.add_reaction(bluecrew)
await msg1.add_reaction(limecrew)
await msg1.add_reaction(whitecrew)
def setup(bot):
bot.add_cog(games(bot))
对不起,如果我没有说对的话。 这也是一个齿轮供参考
【问题讨论】:
标签: python python-3.x discord bots discord.py