有人知道如何让BOT说出频道的所有消息吗?
答案 0 :(得分:1)
您可以编写一个on_message
事件,以回显该频道中其他人发送的消息的内容。
from discord.ext import commands
bot = commands.Bot(command_prefix='!')
channel_ids = ("1234", "5678")
@bot.event
async def on_message(message):
if message.author == bot.user:
return
if message.channel.id in channel_ids:
await bot.send_message(message.channel, message.content)
await bot.process_commands(message)
bot.run("token")