[英]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}")
这应该会为您提供与发件人的消息以及消息的来源。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.