2017 © Pedro Peláez
 

library phergie-whois-on-join-plugin

Phergie plugin to whois a user on join and handle the result.

image

hashworks/phergie-whois-on-join-plugin

Phergie plugin to whois a user on join and handle the result.

  • Friday, April 24, 2015
  • by hashworks
  • Repository
  • 0 Watchers
  • 0 Stars
  • 17 Installations
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

PhergieWhoisOnJoin

Phergie plugin to whois a user on join and handle the result., (*1)

Abandoned!

This plugin is abandoned. Further developement will continue in PhergieUserWatch., (*2)

About

This plugin was originally written to keep the growing amount of chan-whore-monitoring-bots in the Rizon network out of channels. However you can do what you want with the whois result, it'll require a bit of PHP knowledge trough., (*3)

Install

To install via Composer, use the command below, it will automatically detect the latest version and bind it with ~., (*4)

composer require hashworks/phergie-whois-on-join-plugin

See Phergie documentation for more information on installing and enabling plugins., (*5)

Configuration Examples

// Simple example, give voice to every user who joins the channel.
new \hashworks\Phergie\Plugin\WhoisOnJoin\Plugin(function(\hashworks\Phergie\Plugin\WhoisOnJoin\WhoisResult $whoisResult) {
    $whoisResult->setChannelMode('+v', $whoisResult->getNick());
})
// Kick everyone who isn't using a secure connection.
new \hashworks\Phergie\Plugin\WhoisOnJoin\Plugin(function(\hashworks\Phergie\Plugin\WhoisOnJoin\WhoisResult $whoisResult) {
    if (!$whoisResult->hasSecureConnection()) {
        $whoisResult->kick('This channel requires a secure connection.');
    }
})
// This is how I use it. Kickban every user who is in 13 channels or more. Ban based on nick and username, replace numbers with question marks.
new \hashworks\Phergie\Plugin\WhoisOnJoin\Plugin(function(\hashworks\Phergie\Plugin\WhoisOnJoin\WhoisResult $whoisResult) {
    if (count($whoisResult->getChannels()) >= 13) {
        $strReplaceNumbers = array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9);
        $banMask = preg_replace_callback('/^(?<nick>.+?)(?<nicknumbers>[0-9]{0,})!(?<username>.+?)(?<usernumbers>[0-9]{0,})@.+$/', function ($matches) {
                        return $matches['nick'] . str_replace($strReplaceNumbers, '?', $matches['nicknumbers']) . '!' .
                                $matches['username'] . str_replace($strReplaceNumbers, '?', $matches['usernumbers']) . '@*';
        }, $whoisResult->getNick() . '!' . $whoisResult->getUsername() . '@' . $whoisResult->getHost());
        if (!empty($banMask)) {
            $whoisResult->setChannelMode('+b', $banMask);
            $whoisResult->privmsgUser('You have been banned automatically from ' . $whoisResult->getEvent()->getSource() . '. Please contact hashworks to fill a complaint.');
        }
        $whoisResult->kick('You have been kicked automatically. Please contact hashworks to fill a complaint.'); 
    }
})

The Versions

24/04 2015

dev-master

9999999-dev

Phergie plugin to whois a user on join and handle the result.

  Sources   Download

GNU GPL v3.0

The Requires

 

plugin bot irc handler whois phergie join

17/02 2015

v1.0.1

1.0.1.0

Phergie plugin to whois a user on join and handle the result.

  Sources   Download

GNU GPL v3.0

The Requires

 

plugin bot irc handler whois phergie join

15/02 2015

v1.0.0

1.0.0.0

Phergie plugin to whois a user on join and handle the result.

  Sources   Download

GNU GPL v3.0

The Requires

 

plugin bot irc handler whois phergie join

12/02 2015

v0.1.0

0.1.0.0

Phergie plugin to whois a user on join and handle the result.

  Sources   Download

GNU GPL v3.0

The Requires

 

plugin bot irc handler whois phergie join

12/02 2015

v0.0.9

0.0.9.0

Phergie plugin to whois a user on join and handle the result.

  Sources   Download

GNU GPL v3.0

The Requires

 

plugin bot irc handler whois phergie join