Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
useEffect(() => {
const params = {
logLevel: LogLevel.DEBUG,
autoReconnect: true,
useRtmConnect: false
};
const rtm = new RTMClient(token, params);
rtm.start().then(res => console.log("rtm started", res));
rtm.on("message", message => {
// Log the message
console.log(
`(channel:${message.channel}) ${message.user} says: ${message.text}`
);
});
}, []);
}