我听说ctx.typing()存在,但我希望我的机器人在私信中显示该指标。到目前为止,这是我的代码:
@client.event
async def on_message(message):
await client.process_commands(message)
# i want the bot to display 'typing...' for 1 second
if message.guild is None and not message.author.bot:
with open('dmresponses.txt') as input_file:
long_list = [line.strip() for line in input_file]
await message.author.send(random.choice(long_list))
Run Code Online (Sandbox Code Playgroud)
我怎样才能实现这个?