Closed NanoSector closed 9 years ago
If you /msg the bot with a command, it tries to PM itself back.
I applied a dirty hack to work around this. I copied the getUserNickName function from Classes/Listener/Join.php into Classes/Library/IRC/Bot.php. Then I added this bit of code:
After
$command = substr( trim( \Library\FunctionCollection::removeLineBreaks( $args[3] ) ), 1 );
Add:
// Someone PMed me? Oh noes. if ($source == $this->nickToUse && $args[1] == 'PRIVMSG') $source = $this->getUserNickName($args[0]);
That snippet detects if the bot is going to PM itself, then redirects it to PM the actual user back. This seems to work for me.
If you /msg the bot with a command, it tries to PM itself back.
I applied a dirty hack to work around this. I copied the getUserNickName function from Classes/Listener/Join.php into Classes/Library/IRC/Bot.php. Then I added this bit of code:
After
Add:
That snippet detects if the bot is going to PM itself, then redirects it to PM the actual user back. This seems to work for me.