javascript - 运行不和谐机器人后我无法输入终端
问题描述
问:我该怎么办?
这也发生在命令提示符下。我使用 Visual Studio 代码,机器人是用 javascript 编写的。
我目前正在 youtube 上关注本教程,而且我对 javascript 真的很陌生。 https://www.youtube.com/playlist?list=PLbbLC0BLaGjpyzN1rg-gK4dUqbn8eJQq4
主.js:
const client = new Discord.Client();
const prefix = '+';
const fs = require('fs');
client.commands = new Discord.Collection();
const commandFiles = fs.readdirSync('./commands/').filter(file => file.endsWith('.js'));
for(const file of commandFiles){
const command = require(`./commands/${file}`);
client.commands.set(command.name, command);
}
client.once('ready', () => {
console.log('Lama is online!');
});
client.on('message', message =>{
if(!message.content.startsWith(prefix) || message.author.bot) return;
const args = message.content.slice(prefix.length).split(/ +/);
const command = args.shift().toLowerCase();
if(command === 'kick'){
client.commands.get('kick').execute(message, args);
} else if(command === 'youtube'){
client.commands.get('youtube').execute(message, args);
}
});
client.login('token here');
我总是用“node”启动机器人。发不了图,不好意思。
并且在控制台发送“喇嘛在线!”之后 我不能在那里打字。
解决方案
推荐阅读
- python - 是否需要将 pandas 数据帧转换为 numpy 数组以显示其中存储的图像和坐标?
- elixir - 错误的返回值模式
- firebase - 运行 Firestore 本地模拟器时如何查看数据库数据?
- go - 如何使用 pgx 将 QueryRow 扫描到结构中
- angular - 如何使用 ethersjs 和 metamask 使用角度服务签署 sendTransaction
- ansible - Ansible vmware_vm_inventory:如何访问动态主机变量?
- react-native - 如何将组件中的变量传递给函数
- javascript - 两次操作后返回一个 observable
- python - 如何成对过滤正负,因为它们在熊猫数据帧上分组后相互抵消?
- java - 消息:count():参数必须是在centos上实现Countable codeigniter的数组或对象