这是我第一次制作不和谐机器人,这是我的代码,它似乎可以工作,但它只会在我运行时随机化它,然后它重复相同的消息,我如何让它每次选择一个新的报价?
import os
import discord
import random
client = discord.Client()
q_list = ('It came to me. My own. My love. My own. My precious', "Lost! Lost! My Precious is lost!!", "Bagginses? What is a Bagginses, precious?", "What has it got in its nasty little pocketses?", "Curse it and crush it! We hates it forever!")
random_q = random.choice(q_list)
@client.event
async def on_ready():
print('We have logged in as {0.user}'.format(client))
@client.event
async def on_message(message):
if message.author == client.user:
return
if message.content.startswith('smeagol'):
await message.channel.send(random_q)
bot_token = os.environ['bottoken']
client.run(bot_token)