async def on_message(message: discord.Message):
if message.guild is None and not message.author.bot:
msg = message.content
print(msg)
channel = (796761485996982302)
await Bot.channel.send(msg)
await Bot.process_commands(message)
当用户向机器人发送消息时,它会在终端中弹出,但我已尝试将其发送到我选择的服务器频道,但每次都失败
答案 0 :(得分:0)
您需要获取频道然后发送消息
@bot.event
async def on_message(m):
if not m.guild and not m.author.bot:
await bot.get_channel(CHANNEL_ID).send(m.content)
await bot.process_commands(m)