如何在 discord.py 中发送每条消息

How do I send every message in discord.py

所以基本上我想在控制台中重新创建每个不和谐频道

import discord
from discord.ext import commands

b = commands.Bot(command_prefix = ".")
b.remove_command("help")

@b.event
async def on_message():
    print("What ever message the user sent")

b.run('token')

每次用户发送消息时,消息都会被复制到控制台。这可能吗?另外,是否可以查看是哪个用户发送的以及它在哪个频道?我知道您可以获得频道和作者 ID,但是频道名称和用户名呢?

@b.event
async def on_message(message):
    await b.process_commands(message)
    print(f"{message.author} in {message.channel} : {message.content}")

这应该会向您提供消息的发件人以及消息的来源。