Bot Connect Message

connect

#1

PhantomBot Version: 2.3.9 (Revision: 37009b50)
OS Version: Ubuntu 16.10
Java Version: 8
Browser and Version (for Panel Support): Chrome 61.0.3163.100
Stock PhantomBot: Modified quoteSystem.js
Any Recent Changes to Your System: No

Description of Issue: I used the !botName setconnectmessage setup for the first time today, as below.
!darkensanities setconnectmessage Behold, for the avatar of the insane, the Dark Insanity himself, Auroris, has decided to reconnect his bot to the stream!

Yes, I have self-image issues, moving on.
The resultant whisper comes back a little strangely:
Connect message set to: setconnectmessage Behold, for the avatar of the insane, the Dark Insanity himself, Auroris, has decided to reconnect his bot to the stream!

OK, maybe that’s just a weirdness in the settings for that specific whisper. Shoot the bot, restart the bot, wait…

setconnectmessage Behold, for the avatar of the insane, the Dark Insanity himself, Auroris, has decided to reconnect his bot to the stream!

Clearly not just a bug in that message. Fair enough, maybe there’s a thing in the lang file. Pretty sure this would need to be in the main.js lang file.

$.lang.register('init.connected.msg', 'Connect message set to: $1'); $.lang.register('init.connected.msg.usage', '!$1 connectmessage [message]'); $.lang.register('init.connected.msg.removed', 'Connect message removed!');

As far as I can tell, these are the ones that should be determining the thing, but I can’t see where things should be changed.


#2

The error seems to be with the command itself, not the lang file.

Try replacing your setcommandmessage with this:

        /*
         * @commandpath botName setconnectmessage [message] - Sets a message that will be said once the bot joins the channel.
         */
        if (action.equalsIgnoreCase('setconnectmessage')) {
            if (action === undefined) {
                $.say($.whisperPrefix(sender) + $.lang.get('init.connected.msg.usage', bot));
                return;
            }

            var message = args.slice(1).join(' ');// line i changed here. the 1 was a 0.

            $.setIniDbString('settings', 'connectedMsg', message);
            $.say($.whisperPrefix(sender) + $.lang.get('init.connected.msg', message));
        }

You’ll have to restart your bot, and then rerun !botname setconnectmessage

But that should fix it :slight_smile:


#3

Which file is that in?


#4

initCommand.js

Should be in like /scripts/core/


#5

TYVM, will try next time I have a moment.


#6

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