當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Dog::getIRCMsg方法代碼示例

本文整理匯總了PHP中Dog::getIRCMsg方法的典型用法代碼示例。如果您正苦於以下問題:PHP Dog::getIRCMsg方法的具體用法?PHP Dog::getIRCMsg怎麽用?PHP Dog::getIRCMsg使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Dog的用法示例。


在下文中一共展示了Dog::getIRCMsg方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1:

<?php

Dog_Log::error(Dog::getIRCMsg()->getArg(0));
開發者ID:sinfocol,項目名稱:gwf3,代碼行數:3,代碼來源:ERROR.php

示例2: substr

<?php

# :gizmore!gizmore@localhost PRIVMSG Dog :.join #sr
if (false === ($user = Dog::getOrCreateUser())) {
    return;
}
$serv = Dog::getServer();
$serv->addUser($user);
$user = Dog::setupUser();
$chan = Dog::setupChannel();
if ($user === false) {
    return Dog::suppressModules();
}
# Log PRIVMSGs
$msg = Dog::getIRCMsg()->getArg(1);
if (Dog::getIRCMsg()->shouldLog()) {
    Dog_Log::user($user, $msg);
    Dog_Log::channel($chan, $msg);
}
# Exec Stuff
if (!$user->isBot()) {
    if ('' !== ($trigger = Common::substrUntil($msg, ' '))) {
        if (Dog_Init::isTrigger($serv, $chan, $trigger[0])) {
            if ($user->isFlooding()) {
                return;
            }
            Dog::setTriggered();
            $trigger = substr($trigger, 1);
            if (false !== ($plug = Dog_Plugin::getPlug($trigger))) {
                if (!$plug->isInScope($serv, $chan)) {
                    Dog::scopeError($plug->getScope());
開發者ID:sinfocol,項目名稱:gwf3,代碼行數:31,代碼來源:PRIVMSG.php

示例3: msg

 public function msg()
 {
     return trim(Common::substrFrom(Dog::getIRCMsg()->getArg(1), ' ', ''));
 }
開發者ID:sinfocol,項目名稱:gwf3,代碼行數:4,代碼來源:Dog_Plugin.php

示例4:

<?php

# :Dog!Dawg@localhost JOIN :#sr
$msg = Dog::getIRCMsg();
$serv = Dog::getServer();
if (false === ($user = Dog::getOrCreateUser())) {
    return Dog_Log::critical("Cannot create user!");
}
$serv->addUser($user);
if (false === Dog::setupUser()) {
    return Dog_Log::critical('Cannot setup user!');
}
$chan_name = $msg->getArg(0);
if (false === ($channel = $serv->getChannelByName($chan_name))) {
    if (false === ($channel = Dog_Channel::getOrCreate($serv, $chan_name))) {
        return;
    }
    $serv->addChannel($channel);
}
$channel->addUser($user);
if (false === Dog::setupChannel()) {
    Dog_Log::critical('Cannot setup channel.');
}
開發者ID:sinfocol,項目名稱:gwf3,代碼行數:23,代碼來源:JOIN.php

示例5:

<?php

if (false === ($user = Dog::getOrCreateUser())) {
    return;
}
$serv = Dog::getServer();
$serv->addUser($user);
$user = Dog::setupUser();
$chan = Dog::setupChannel();
$msg = Dog::getIRCMsg()->getArg(0);
if ($user !== false) {
    Dog_Log::user($user, $msg);
}
if ($chan !== false) {
    Dog_Log::channel($chan, $msg);
}
開發者ID:sinfocol,項目名稱:gwf3,代碼行數:16,代碼來源:NOTICE.php

示例6: msg

 public function msg()
 {
     return Dog::getIRCMsg()->getArg(1);
 }
開發者ID:sinfocol,項目名稱:gwf3,代碼行數:4,代碼來源:Dog_Module.php

示例7: strtolower

<?php

$user = Dog::getUser();
$server = Dog::getServer();
$message = Dog::getIRCMsg()->getArg(1);
$cmd = strtolower(Common::substrUntil($message, ' ', $message));
$msg = Common::substrFrom($message, ' ', $message);
switch ($cmd) {
    case "ping":
    case "time":
    case "action":
    case "finger":
        break;
    case 'version':
        $user->sendCTCP(sprintf('VERSION Dog v%s. Http://dog.gizmore.org', DOG_VERSION));
        break;
}
Dog_Module::map('trigger_ctcp', array($cmd, $msg));
開發者ID:sinfocol,項目名稱:gwf3,代碼行數:18,代碼來源:CTCP.php

示例8: getOrCreateUser

 /**
  * Called by events to get or create the user.
  * @return Dog_User
  */
 public static function getOrCreateUser()
 {
     $username = Common::substrUntil(Dog::getIRCMsg()->getFrom(), '!');
     return self::getOrCreateUserByName($username);
 }
開發者ID:sinfocol,項目名稱:gwf3,代碼行數:9,代碼來源:Dog.php


注:本文中的Dog::getIRCMsg方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。