Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/280.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python Discord.py |发布消息_Python_Discord_Bots_Message_Publish - Fatal编程技术网

Python Discord.py |发布消息

Python Discord.py |发布消息,python,discord,bots,message,publish,Python,Discord,Bots,Message,Publish,有人知道如何通过用户发布消息吗?我已经在discord编码服务器上尝试了一些,并询问了一些问题,但我没有得到一个好的答案 我试过这样的方法: @client.event async def on_message(message): if message.channel.type == discord.ChannelType.news: await message.publish return 我还没有直接回复凤凰城末日的名声。 然而,我认为bendix9

有人知道如何通过用户发布消息吗?我已经在discord编码服务器上尝试了一些,并询问了一些问题,但我没有得到一个好的答案

我试过这样的方法:

@client.event
async def on_message(message):
    if message.channel.type == discord.ChannelType.news:
        await message.publish
        return

我还没有直接回复凤凰城末日的名声。 然而,我认为bendix9009可能是指在文本频道中键入消息时得到的“发布”选项

当您或bot向这些通道发送消息时,默认情况下,这些消息不会发布到跟随它们的任何其他通道

了解您是否可以在下面的行中添加某种标志以自动发布这些消息是很有用的

client.channels.cache.get(channelId.send)(我的是用javascript写的)

你说的“发布消息”是什么意思?