Bot (tmi.js) not detecting subscriptions...?

My bot was firing on every event just fine a couple weeks ago, everything was solid. Right about the time that sub gifting was implemented, the bot stopped detecting ANY new subs, to include paid tier subs and gifted subs. (It never acknowledged gifted subs under the subscription event, even when it did work.) client.on('subscription' no longer works at all. Resubs are fine. Cheering is fine. All other events seem to function with no issues at all. I hadn’t made any changes to the bot around that time. Has anything in the system changed with the subscription event specifically, or is something likely just amiss within my code?

Here’s the entire section:

var tmi = require('tmi.js');

var options = {
	options: {
		debug: true
	},
	connection: {
		cluster: "aws",
		reconnect: true
	},
	identity: {
		username: "forbidinjustice",
		password: "oauth:redacted"
	},
	channels: ["channelone","channeltwo"]
};

var client = new tmi.client(options);
client.connect();


client.on('subscription', function (_channel, username, method, message, userstate) {
    let channel = _channel.slice(1);
    let output = '';
    switch(channel) {
        case 'channelone':
            output = "Thanks for subscribing to Channel One!";
            break;
        case 'channeltwo':
            output = "Thanks for subscribing to Channel Two!";
            break;
    }
    if(output) client.say(channel, output);
});

Sub gifting data is not available in tmi.js currently, it needs some TLC, but the regular subscription events have not stopped working for my bot. Also, you no longer need the connection.cluster property in the options.

Also, if you want resubs too, you need to listen for that event too. See the docs

Yes, I have the resub and cheer events on my actual bot code. I omitted them for this thread because they function correctly. It’s only the subscription event that does not work; no new subs of any kind are detected. Resubs are fine, though. Does the above code look correct to you otherwise? I’ve been over it a dozen times and can’t determine why it isn’t firing.

We are not TMI.js support you may have better luck with this issue from the TMI.js Github https://github.com/tmijs/tmi.js/issues/262

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.