简体   繁体   English

是否可以通过发送消息来打开 discord.js 机器人?

[英]is it possible to turn on a discord.js bot by sending a message?

I have recently created a discord bot and am currently having a ton of fun!我最近创建了一个不和谐的机器人,目前玩得很开心! I can turn it off by sending a message on my server but I still wonder if there is any way to turn it on by doing the same.我可以通过在我的服务器上发送消息来关闭它,但我仍然想知道是否有任何方法可以通过执行相同的操作来打开它。 All I want is to send something like "bot on" in my server and make the bot turn on.我想要的只是在我的服务器中发送诸如“bot on”之类的东西并使机器人开启。

The bot must be turned on to receive messages so that's not possible.必须打开机器人才能接收消息,所以这是不可能的。 However, you can start a bot that will start your other bot when a message is received.但是,您可以启动一个机器人,该机器人将在收到消息时启动您的另一个机器人。

I think a simpler way to do it would to make one command be sort of a toggle, so that when it is sent the bot starts replying/interacting, and when sent again discontinues.我认为一种更简单的方法是使一个命令成为一种切换,以便在发送时机器人开始回复/交互,并在再次发送时停止。 The easiest way to signify the status would be with the Activity Status (the text) or the regular Status (do not disturb compared to online).表示状态的最简单方法是使用活动状态(文本)或常规状态(与在线相比,请勿打扰)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM