liamcottle / rustplus.js

Unofficial NodeJS library for controlling Smart Switches in the PC game Rust
224 stars 46 forks source link

See group chat message #26

Closed Umberghost closed 3 years ago

Umberghost commented 3 years ago

Us there any way to see whenever a game chat message has been sent (and the content on that data)?

Thanks in advance, been using the npmjs package for a week and it's sooo good, great work!

liamcottle commented 3 years ago

Thanks for the feedback! Unfortunately that's not possible though, as the Rust+ app only allows access to team messages.

Umberghost commented 3 years ago

And with the current api, can you get the current team chat? Didn't see any method for it.

liamcottle commented 3 years ago

You can grab the team chat history like so:

rustplus.sendRequest({
    getTeamChat: {

    },
}, (message) => {
    console.log(message);
});

or with promises:

rustplus.sendRequestAsync({
    getTeamChat: {},
}).then((response) => {

    // AppResponse
    console.log(response);

}).catch((error) => {

    // AppError or Error('Timeout');
    console.log(error);

});