/mods and /vips Broken?

#1

ok so i just went as far back as PhantomBot v2.4.1 and the code below failed to pick up on /mods and /vips output

$.bind('ircPrivateMessage', function (event) {
	var sender = event.getSender().toLowerCase(),
		message = event.getMessage().toLowerCase();

	$.log.file('test-messages', '' + sender + ': ' + message);
});

also the code below thats in logging.js doesnt work eather for /mods

if (message.indexOf('the moderators if this room') === -1) {
    logfile('private-messages', '' + sender + ': ' + message);
}

EDIT
just looked into it more even in the main PhantomBot.java the code below is never triggered as its not detected :slight_smile:

if (message.startsWith("The moderators of this room are: ")) {
    String[] moderators = message.substring(33).split(", ");

    /* Check to see if the bot is a moderator */
    for (String moderator : moderators) {
        if (moderator.equalsIgnoreCase(this.botName)) {
            EventBus.instance().postAsync(new IrcChannelUserModeEvent(this.session, this.session.getBotName(), "O", true));
            /* Allow the bot to sends message to this session */
            event.getSession().setAllowSendMessages(true);
        }
    }
}
#2

ok to add onto this i just added this line com.gmt2001.Console.out.println(rawMessage); into public void parseData(String rawMessage) function in the TwitchWSIRCParser.java file and it does not even pick up on both the /mods or /vip command

#3

Seems to work here?

debugon
[05-08-2019 @ 08:35:19.846 ADT] [CONSOLE] Executing debugon: Enable Debug Mode
[05-08-2019 @ 08:35:19.847 ADT] Debug Mode Enabled
chat .mods
[05-08-2019 @ 08:35:21.835 ADT] [DEBUG] [onEvent()@ScriptEventManager.java:77] Dispatched event ConsoleInputEvent
[05-08-2019 @ 08:35:21.837 ADT] callHook: command [chat] hookname + [command]
[05-08-2019 @ 08:35:21.838 ADT] callHook: index [8]
[05-08-2019 @ 08:35:21.841 ADT] [CHAT] .mods
[05-08-2019 @ 08:35:21.842 ADT] [DEBUG] [onEvent()@ScriptEventManager.java:77] Dispatched event CommandEvent
[05-08-2019 @ 08:35:21.985 ADT] [DEBUG] [onNotice()@TwitchWSIRCParser.java:479] Message from jtv (NOTICE): The moderators of this channel are: fossabot, moobot, slammerbot
#4

oh you have to do it via the command not going to the channel on the bot account and doing /mods or /vips

#5

Correct

#6

Twitch sends the reply to those commands directly to the connection that issued the command, not to all connections

1 Like