如何将消息发送到其他服务器.不和谐机器人 [英] How to send a message to a different server | Discord Bot
本文介绍了如何将消息发送到其他服务器.不和谐机器人的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我很好奇,因为我已经看到其他机器人执行此操作,food bot命令将为:!Order",然后它将另一个嵌入发送到其他服务器和特定频道.我该如何编码?
I am very curious because I have seen other bots do this, the food bot command would be: "!Order" and then it would send another embed to a different server and a specific channel. How do I code that?
推荐答案
您可以获取公会,然后从公会获取频道.
You can get a guild and then get a channel from the guild.
client.guilds.get(<guild id>).channels.get(<channel id>).send(<message>)
请注意,这要求漫游器同时存在于两个公会中
Notice this requires the bot to be in both guilds
这篇关于如何将消息发送到其他服务器.不和谐机器人的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文