好的,我想这样我就可以在一个特定的服务器和通道中从控制台发送消息。我在另一篇文章中看到了如何在特定的服务器和频道上发送消息,但是他们来自discord应用程序而不是控制台。有人能帮我吗?在
我想要,所以我键入msg [server-id-here] [channel-name] [message]
例如
msg 493121776402825219 general hello
我有代码,但有错误
@bot.event
async def on_ready(ch, *, msg):
while msg:
channel = bot.get_channel(ch)
msg=input("Mensagem: ")
if channel:
await bot.send_message(channel, msg)
else:
await bot.say("I can't find that channel")
输出的错误
TypeError: on_message() missing 1 required positional argument: 'ch'
使用say命令。在
我不知道这实际上是可能的,但是你可以实现一个新的命令来实现它,这是我为welcomer使用的命令
这使得bot在你所说的地方重复你所说的,但是如果你想通过ID向特定的频道发送消息,你可以这样做
^{pr2}$相关问题 更多 >
编程相关推荐