Skip to content

tmi.js v1.7.0

Compare
Choose a tag to compare
@AlcaDesign AlcaDesign released this 19 Dec 04:29
· 1 commit to c8d507c22fc987f49c01446879b4016802441e9f since this release

v1.7.0 b9cd4b6

  • e4a58a9 notice event now includes unknown notices msg-ids for future usage.
  • #402 If an action message (/me) includes bits, it will be emitted as a cheer event instead. The message-type now reflects if it's a chat or action message.
client.on('cheer', (channel, tags, message) => {
    if(tags['message-type'] === 'action') console.log('Cheer message included /me');
});
  • 7e6f9f2 raided event viewers parameter is now parsed as a number and includes tags as the fourth parameter.
client.on('raided', (channel, username, viewers, tags) => {});
  • dc9495e Set the join interval with options.joinInterval. This allows joining channels from the channels list much faster. Default is still 2000ms. As low as 300ms per Twitch rate limit.
  • #405 Option connection.secure is now enabled by default. #394
  • 4783dba Replaced request package with node-fetch. This majorly reduces the dependency tree.
  • 1163a43 Use XHR instead of JSONP.
  • dd5ece0 Added options.globalDefaultChannel to set the default global channel instead of the default #tmijs. Only affects client.userstate. This is used in case the "tmijs" Twitch channel disappears in the future.
  • 6059f30 Whispers now reject on no_permission NOTICE.
  • #435 Add options.messagesLogLevel to set the log level for chat messages, defaults to "info".
  • #442 Add redeem event. This event will only be received for rewards and custom rewards with user text.
client.on('redeem', (channel, username, rewardType, tags, message) => {
    switch(rewardType) {
        // Message that appears "highlighted" in the chat.
        case 'highlighted-message': break;
        // Message that skips the subscriber-only mode
        case 'skip-subs-mode-message': break;
        // Custom reward ID
        case '27c8e486-a386-40cc-9a4b-dbb5cf01e439': break;
    }
});

Fixes

  • #378 Fixed warning: "possible EventEmitter memory leak detected".
  • 98ce79f invalid_user msg-id now rejects command promises.
  • a626924 Fixed "global is not defined" in Angular. #369
  • 1cea97c Internal calls to connect are now caught and sent to the logger.
  • #425 Fixed moderator tracking for USERSTATE messages.
  • ffe4f48 Add missing VIP rejection bad_vip_max_vips_reached

v1.6.0 ddced23

  • #347 Use a function for identity.password in the configuration to use a dynamically generated token.
const client = new tmi.Client({
    /* ... */
    identity: {
        username: 'alca',
        async password() {
            const user = await db.getUser({ userId: '7676884' });
            const token = await getAccessToken(user.refresh_token);
            return token;
        }
    }
});