Closed Khyretos closed 11 months ago
Set options.skipUpdatingEmotesets
to true
const client = new tmi.Client({
options: {
skipUpdatingEmotesets: true
}
});
i am still getting the error.
for some reason it says its already declared.
here is my code;
/* global showChatMessage, getPostTime, playVoice, playSound, settings, env, twitchTemplate */
const tmi = require('tmi.js');
// Create a client with the specified options
const client = new tmi.Client({
skipUpdatingEmotesets: true,
identity: {
username: settings.TWITCH.USERNAME,
password: `oauth:${settings.TWITCH.OAUTH_TOKEN}`,
},
channels: [settings.TWITCH.CHANNEL_NAME],
});
client.connect().catch(console.error);
client.on('message', (channel, tags, message, self) => {
if (self) {
return;
} // Ignore messages sent by the bot itself
// Filter out custom Twitch emotes from the message
const emotes = tags.emotes || {};
const emoteValues = Object.values(emotes);
let fileteredMessage = message;
const slicedPart = [];
emoteValues.forEach((entry) => {
const [start, end] = entry[0].split('-');
slicedPart.push(fileteredMessage.slice(parseInt(start), parseInt(end) + 1));
});
slicedPart.forEach((entry) => {
fileteredMessage = fileteredMessage.replace(entry, '');
});
if (message !== '') {
// Log the received message
console.log(`${tags['display-name']}: ${fileteredMessage}`);
}
});
class Twitch {
// Filter out custom Twitch emotes from the message
static sendMessage(message) {
client.say(settings.TWITCH.CHANNEL_NAME, message);
}
}
const twitch = new Twitch();
module.exports = twitch;
Check my example again. It needs to go under the options
group.
Check my example again. It needs to go under the
options
group.
my bad!
Actual behaviour: after connecting it periodically logs an error, without doing anything.
Expected behaviour: no error logs if no actions are made
Error log: https://api.twitch.tv/kraken/chat/emoticon_images?emotesets=0,42,19194,300374282![image](https://github.com/tmijs/tmi.js/assets/25864917/e7937a7e-fc5b-42c7-a43f-a66b693ceaa5)
Configuration