Show Current Host in Discord


#1

If I’m hosting or raiding someone the bot should tell that the people in Discord so I can recommend them easily. Is this somehow possible?


#2

That Sounds like a cool idea


#3

Since you ask if it is possible, yes, write a custom script. Kappa.

Sorry, on vacation and couldn’t resist :slight_smile:


#4

I mean do Twitch send the bot the information, that the user is hosting someone? I could write a script, If I know that we have this hook implemented. I don’t use the “!host” - I only use “/raid” or the “Host”-Button from BTTV


#5

Something like this will work :slight_smile:

(function() {
    $.bind('ircPrivateMessage', function(event) {
        var sender = event.getSender().toLowerCase(),
            message = event.getMessage().toLowerCase();
            modLogs = $.getSetIniDbBoolean('discordSettings', 'modLogs', true),
            modLogChannel = $.getSetIniDbString('discordSettings', 'modLogChannel', '');

        if (!modLogs) {
            return;
        }
        if (message.indexOf('hosting') !== -1) {
            var target = String(message).replace('now hosting', '');

            if (target.equalsIgnoreCase('-')) {
                return;
            } else {
                $.discordAPI.sendMessageEmbed(modLogChannel, 'green', 'Now Hosting' + target);
            }
        }
    });
})();