Closed AsutoraGG closed 2 years ago
Your code doesn't appear to be connecting to the server at all.
You need to connect to the server before you can send any requests like sendTeamMessage
.
The docs show an example on how to do this properly.
const RustPlus = require('@liamcottle/rustplus.js');
var rustplus = new RustPlus('ip', 'port', 'playerId', 'playerToken');
// wait until connected before sending commands
rustplus.on('connected', () => {
// ready to send requests
rustplus.sendTeamMessage('Hello from rustplus.js!');
});
// connect to rust server
rustplus.connect();
I'm making a private BOT now. The code is this When I run it I get an error like this :