【发布时间】:2020-11-08 08:15:32
【问题描述】:
我正在使用python 和discord.py 玩discord 机器人。我在discord 上启用了TTS,即使我使用标签tts=False,只要我让机器人向频道发送消息,它就会使用tts 读出消息。我不知道如何禁用它,因为文档只是说使用tts=False,这就是我正在做的。因此,在下面的示例中,当输入 .ping 时,tts 会读出 "Bot says My ping is 10ms" 并将相同的消息发送到频道,我希望它只是将消息发送到频道而不是读出。
import discord
from discord.ext import commands
client = commands.Bot(command_prefix = ".")
@client.event
async def on_ready():
print("Bot is running")
@client.command()
async def ping(ctx):
await ctx.send(f"My ping is {round(client.latency * 1000)} ms ",tts=False)
client.run(token)
【问题讨论】:
标签: python discord bots discord.py text-to-speech