当前位置: 首页>>代码示例>>PHP>>正文


PHP Dog::getNickname方法代码示例

本文整理汇总了PHP中Dog::getNickname方法的典型用法代码示例。如果您正苦于以下问题:PHP Dog::getNickname方法的具体用法?PHP Dog::getNickname怎么用?PHP Dog::getNickname使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Dog的用法示例。


在下文中一共展示了Dog::getNickname方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: replaceLang

 private function replaceLang($text, $args, $trigger = '')
 {
     $t = Dog::getTrigger();
     $text = str_replace(array('%T%', '%CMD%', '%BOT%'), array($t, $t . $trigger, Dog::getNickname()), $text);
     return $args === NULL ? $text : vsprintf($text, $args);
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:6,代码来源:Dog_Module.php

示例2: replaceArgs

 private function replaceArgs($back, $args = NULL)
 {
     $t = Dog::getTrigger();
     $back = str_replace(array('%BOT%', '%CMD%', '%T%'), array(Dog::getNickname(), $t . $this->name, $t), $back);
     return $args === NULL ? $back : vsprintf($back, $args);
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:6,代码来源:Dog_Plugin.php

示例3:

<?php

# :lindbohm.freenode.net 437 * Dog :Nick/channel is temporarily unavailable
if (Dog::argv(1) === Dog::getNickname()) {
    include '433.php';
    # Nickname in use.
}
开发者ID:sinfocol,项目名称:gwf3,代码行数:7,代码来源:437.php

示例4: array

<?php

$lang = array('en' => array('help' => '%CMD% <nickname>. Change the bot`s nickname.', 'curr' => 'My current nick here is %s.', 'ok' => 'Sending the NICK command...'));
$plugin = Dog::getPlugin();
$argv = $plugin->argv();
$argc = count($argv);
if ($argc === 0) {
    $plugin->rply('curr', array(Dog::getNickname()));
} elseif ($argc === 1 && preg_match('/^[a-z0-9_]+$/i', $argv[0])) {
    $plugin->rply('ok');
    Dog::getServer()->sendRAW("NICK {$argv[0]}");
} else {
    $plugin->showHelp();
}
开发者ID:sinfocol,项目名称:gwf3,代码行数:14,代码来源:nick_Ib.php

示例5: foreach

# :Dog!gizmore@localhost NICK gizmore
$old_user = Dog::setupUser();
$serv = Dog::getServer();
if (false === ($new_user = Dog::getOrCreateUserByName(Dog::argv(0)))) {
    Dog::suppressModules();
    return Dog_Log::critical('Cannot create user!');
}
# Copy channels with privs
if ($old_user) {
    $old_uid = $old_user->getID();
    $serv->addUser($new_user);
    foreach ($serv->getChannels() as $channel) {
        $channel instanceof Dog_Channel;
        if (false !== $channel->getUserByID($old_uid)) {
            $channel->addUser($new_user, $channel->getPriv($old_user));
        }
    }
    $serv->removeUser($old_user);
    echo "OLD DOG: {$old_user->getName()}\n";
    echo "OLD DOG: " . Dog::getNickname() . "\n";
    if ($old_user->getName() === Dog::getNickname()) {
        if (false !== ($nick = Dog_Nick::getExistingNick($serv, Dog::argv(0)))) {
            $serv->setNick($nick);
            $serv->setNicknum(0);
            $nick->identify();
        } else {
            $serv->setNickName(Dog::argv(0));
        }
    }
}
开发者ID:sinfocol,项目名称:gwf3,代码行数:30,代码来源:NICK.php

示例6: array

<?php

# :irc.giz.org 001 Dog :Welcome to the gizmore IRC Network Dog!Dawg@localhost
# Set bot mode
$server = Dog::getServer();
$nick = Dog::getNickname();
Dog::getOrCreateUserByName(Dog::argv(0));
if (!$server->isOptionEnabled(Dog_Server::NO_BOTFLAG)) {
    $server->sendRAW("MODE {$nick} +b");
    $server->sendRAW("MODE {$nick} +B");
}
if (false !== ($connector = $server->getVarDefault('dog_connector', false))) {
    $server->unsetVar('dog_connector');
    $connector instanceof Dog_User;
    $connector->sendPRIVMSG(Dog::lang('msg_connected', array($server->displayLongName(), Dog::getNickname(), $server->getConf('ircoppass'))));
}
$server->saveOption(Dog_Server::HAS_CONNECTED_ONCE);
$server->getNick()->identify();
开发者ID:sinfocol,项目名称:gwf3,代码行数:18,代码来源:001.php

示例7:

<?php

# :gizmore!gizmore@localhost KICK #sr Dog :gizmore
Dog::setupUser();
$server = Dog::getServer();
$channel = Dog::setupChannel();
if (false !== ($user = Dog::getOrLoadUserByArg(Dog::argv(1)))) {
    $channel->removeUser($user);
}
if (Dog::getNickname() === $user->getName()) {
    $server->removeChannel($channel);
}
开发者ID:sinfocol,项目名称:gwf3,代码行数:12,代码来源:KICK.php


注:本文中的Dog::getNickname方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。