如何在命令后控制台记录消息的第二部分 [英] How can I console.log the 2nd part of the message after the command

查看:11
本文介绍了如何在命令后控制台记录消息的第二部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个名为 -note 的命令,它将向控制台发送一个便笺供我查看.我似乎无法弄清楚如何在命令之后拆分第二部分,然后将其记录到控制台.谢谢

Im making a command called -note, which would send a note to console for me to look at. I can't seem to figure out how to split the 2nd part after the command and then log it to console. Thanks

推荐答案

这很简单:

let msg = message.content.split(" ").slice(1).join(" ");
console.log(msg);

这篇关于如何在命令后控制台记录消息的第二部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆