小编IAm*_*man的帖子

(discord.py) 如何在 DM 中显示机器人输入指示器

我听说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)

我怎样才能实现这个?

python python-3.x discord discord.py

2
推荐指数
1
解决办法
2682
查看次数

标签 统计

discord ×1

discord.py ×1

python ×1

python-3.x ×1