本文整理汇总了PHP中Dog::rply方法的典型用法代码示例。如果您正苦于以下问题:PHP Dog::rply方法的具体用法?PHP Dog::rply怎么用?PHP Dog::rply使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dog
的用法示例。
在下文中一共展示了Dog::rply方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: on_autojoin_Ac
public function on_autojoin_Ac()
{
$user = Dog::getUser();
$server = Dog::getServer();
$argv = $this->argv();
$argc = count($argv);
# Invoked in channel.
switch ($argc) {
# .autojoin
case 0:
return $this->showStatus($channel);
# .autojoin on|#channel
# .autojoin on|#channel
case 1:
if (Dog_Var::isValid('b', $argv[0])) {
return $this->setEnabled($channel, Dog_Var::parseValue('b', $argv[0]));
} elseif (false === ($channel = Dog::getOrLoadChannelByArg($argv[0]))) {
return Dog::rply('err_channel');
} else {
return $this->showStatus($channel);
}
# .autojoin #wechall on
# .autojoin #wechall on
case 2:
if (false === ($channel = Dog::getOrLoadChannelByArg($argv[0]))) {
return Dog::rply('err_channel');
}
if (!Dog::hasPermission($server, $channel, $user, 'A')) {
return Dog::noPermission('s');
}
return $this->setEnabled($channel, Dog_Var::parseValue('b', $argv[1]));
}
$this->showHelp('autojoin');
}
示例2: on_scum_Pc
public function on_scum_Pc()
{
if (false === ($chanel = Dog::getChannel())) {
return Dog::rply('err_only_channel');
}
$user = Dog::getUser();
$msg = $this->msgarg();
$command = Common::substrUntil($msg, ' ', $msg);
$message = Common::substrFrom($msg, ' ', '');
switch ($command) {
case '':
case 'help':
$out = $this->scumHelp($message);
break;
case 'init':
$out = $this->scumInit($user);
break;
case 'join':
$out = $this->scumJoin($user);
break;
case 'start':
$out = $this->scumStart($user);
break;
case 'cards':
$out = $this->scumCards($user);
break;
case 'turn':
case 'deck':
$out = $this->scumDeck($user);
break;
case 'top5':
$out = $this->scumTop5($user, $message);
break;
case 'stats':
$out = $this->scumStats($user, $message);
break;
case 'abort':
$out = $this->scumAbort($user);
break;
case 'pass':
$out = $this->scumPass($user);
break;
default:
$out = $this->scumPlay($user, $msg, false);
break;
}
return Dog::reply($out);
}
示例3: on_seen_Pb
/**
* We got triggered by !seen.
*/
public function on_seen_Pb()
{
$argv = $this->argv();
$argc = count($argv);
if ($argc === 1) {
if (!preg_match('/^[a-z0-9_!]+$/iD', $argv[0])) {
return Dog::rply('err_user');
}
if (false === ($server = Dog::getServerBySuffix($argv[0]))) {
return Dog::rply('err_server');
}
if (false === ($user = Dog_User::getByLongName($argv[0]))) {
return Dog::rply('err_user');
}
if (false === ($seen = Dog_Seen::getSeen($user))) {
return $this->rply('never', array($user->displayName()));
}
$channel = $seen->getChannel();
$channam = $channel === false ? '!NOCHAN!' : $channel->displayName();
$this->rply($seen->getEvent(), array($user->displayName(), $server->displayName(), $channam, $seen->displayDate(), $seen->displayAge(), $seen->getMessage()));
} else {
$this->showHelp('seen');
}
}
示例4: setVar
public static function setVar(array $vars, $scope = NULL, $varname, $value)
{
if (false === ($var = self::getVar($vars, $varname, $scope))) {
Dog::rply('err_unk_var');
} elseif (!self::isValid($var->getType(), $value)) {
Dog::rply('err_variabl', array($var->displayName(), $varname, $var->displayType()));
} elseif (!$var->hasPermission(Dog::getServer(), Dog::getChannel(), Dog::getUser())) {
Dog::noPermission($var->getPriv());
} elseif (false === ($oldval = $var->getValue())) {
Dog::err('ERR_DATABASE', array(__FILE__, __LINE__));
} elseif (!$var->setValue($value)) {
Dog::err('ERR_DATABASE', array(__FILE__, __LINE__));
} else {
Dog::rply('msg_set_var', array($var->displayName(), $varname, $oldval, $var->getValue()));
}
}
示例5: permissionError
public static function permissionError($privchar)
{
Dog::rply('err_no_perm', array($privchar, self::lang('priv_' . $privchar)));
}
示例6: showConfigVarNames
public function showConfigVarNames($scope)
{
Dog::rply('msg_plgvars', array($this->displayName(), Dog_Var::showVarNames($this->getConfigVars(), $scope)));
}
示例7: array
<?php
$lang = array('en' => array('help' => 'Usage: %CMD%. Restart all timers.', 'ok' => 'Timers have been successfully flushed. %BOT% is sleeping for %d milliseconds each loop.'));
$millis = Dog_Init::getSleepMillis();
Dog_Timer::flush();
Dog_Timer::init(Dog_Init::getSleepMillis());
Dog_Init::initTimers();
Dog::rply('ok', array($millis));
示例8: array
<?php
$lang = array('en' => array('help' => 'Usage: %CMD%. Show information of the current song played at http://slayradio.org - mplayer http://relay1.slayradio.org:8000', 'np' => 'Now Playing on http://slayradio.org %s - %s (requested by %s)', 'live' => "There is probably a live show on http://slayradio.org: %s.", 'ki' => 'SlayRadio AI'));
$plugin = Dog::getPlugin();
$ki = $plugin->lang('ki');
$url = 'http://slayradio.org/now_playing.php';
if (false === ($result = GWF_HTTP::getFromURL($url))) {
return Dog::rply('err_response');
}
# <strong>Lagerfeldt</strong><br>R-Type (Doppelganger Summer Remix)<p align="center"><small>Requested by <b><i>zeddan</i></b> <br></small>
if (preg_match('#<strong>([^<]+)</strong><br>([^<]+)<p align="center"><small>Requested by <b><i>([^<]+)</i></b> <br></small>#', $result, $matches)) {
$plugin->rply('np', array(utf8_encode(html_entity_decode($matches[1], ENT_QUOTES)), utf8_encode(html_entity_decode($matches[2], ENT_QUOTES)), utf8_encode(html_entity_decode($matches[3], ENT_QUOTES))));
} elseif (preg_match('#<strong>([^<]+)</strong><br>([^<]+)<p align="center">#', $result, $matches)) {
$plugin->rply('np', array(utf8_encode(html_entity_decode($matches[1], ENT_QUOTES)), utf8_encode(html_entity_decode($matches[2], ENT_QUOTES)), $ki));
} elseif (preg_match('#<strong>([^<]+)</strong><br>([^<]+)<br>#', $result, $matches) && preg_match('#<small>Requested by <b><i>([^<]+)</i></b> <br></small>#', $result, $matches2)) {
$plugin->rply('np', array(utf8_encode(html_entity_decode($matches[1], ENT_QUOTES)), utf8_encode(html_entity_decode($matches[2], ENT_QUOTES)), utf8_encode(html_entity_decode($matches2[1], ENT_QUOTES))));
} elseif (1 === preg_match('#<strong>([^<]+)</strong><br>([^<]+)<br>#', $result, $matches)) {
$plugin->rply('np', array(utf8_encode(html_entity_decode($matches[1], ENT_QUOTES)), utf8_encode(html_entity_decode($matches[2], ENT_QUOTES)), $ki));
} elseif (true === false) {
} elseif (1 === preg_match('#<font size="\\+1">([^<]+)</font>#', $result, $matches)) {
$plugin->rply('live', array($matches[1]));
Dog::reply(sprintf('', $matches[1]));
} else {
Dog::rply('err_response');
}
示例9: array
<?php
$lang = array('en' => array('help' => 'Usage: %CMD% <user[!SID]>. Remove the password for a user.', 'removed' => 'The password for %s has been removed.'));
$plugin = Dog::getPlugin();
$argv = $plugin->argv();
$argc = count($argv);
if ($argc !== 1) {
$plugin->showHelp();
} elseif (false === ($user = Dog::getOrLoadUserByArg($argv[0]))) {
Dog::rply('err_user');
} else {
$user->saveVar('user_pass', NULL);
$plugin->rply('removed', array($user->displayName()));
}
示例10: array_shift
$plugin = Dog::getPlugin();
$message = $plugin->argv();
if (count($message) < 2) {
return $plugin->showHelp();
}
$arg = array_shift($message);
$message = implode(' ', $message);
# Admin
if (Dog::hasPermission($serv, false, $user, 'a')) {
if (false !== ($channel = Dog::getChannelByArg($arg))) {
return $channel->sendAction($message);
} elseif (false !== ($tuser = Dog::getUserByArg($arg))) {
return $tuser->sendAction($message);
}
} elseif (DOG::hasPermission($serv, false, $user, 's')) {
if (false !== ($channel = $serv->getChannelByName($arg))) {
return $channel->sendAction($message);
} elseif (false !== ($tuser = $serv->getUserByName($arg))) {
return $tuser->sendAction($message);
}
} else {
if (false !== ($channel = $serv->getChannelByName($arg))) {
return $channel->sendAction($message);
}
}
# Errors
if (false !== ($channel = Dog::getChannelByArg($arg)) || false !== ($tuser = Dog::getUserByArg($arg))) {
return Dog::noPermission('a');
} else {
return Dog::rply('err_target');
}
示例11: array
<?php
$lang = array('en' => array('help' => 'Usage: %CMD% [[<server>:]<channel>] [<nickname>]'));
return;
$plug = Dog::getPlugin();
$user = Dog::getUser();
$serv = Dog::getServer();
$chan = Dog::getChannel();
$argv = $plug->argv();
$argc = count($argv);
$showhelp = false;
if ($argc === 2) {
$nickname = array_pop($argv);
if (!Dog_IRCRFC::isValidNickname($nickname)) {
return Dog::rply('err_nickname');
}
$argc--;
}
if ($argc === 1) {
$servchan = $argv[0];
} else {
$showhelp = true;
}
if ($showhelp) {
return $plug->showHelp();
}
$url = "https://widget00.mibbit.com/?server={$server}%3A%2B6666&channel={$channel}&noServerNotices=true&noServerMotd=true&nick={$nickname}&forcePrompt=true";
示例12: implode
$out .= implode(', ', $triggers);
$out .= '.';
}
}
$user = Dog::getUser();
$user->sendNOTICE(substr($out, 1));
# Plugins
$out = '';
$plugdir = Dog_Plugin::getPlugDir();
GWF_File::filewalker($plugdir, 'dogplug_help_all', false, true, strlen($plugdir) + 1);
ksort($DPH_ALL);
foreach ($DPH_ALL as $folder => $commands) {
sort($commands);
$out .= ' ' . chr(2) . $folder . chr(2) . ': ';
$out .= implode(', ', $commands);
$out .= '.';
}
$user->sendNOTICE(substr($out, 1));
} elseif ($argc === 1) {
if (false !== ($plug = Dog_Plugin::getPlug($argv[0]))) {
$scopetxt = dogplug_scopetxt($plugin, $plug->getPriv(), $plug->getScope());
$plugin->reply($plug->getHelp() . $scopetxt);
} elseif (false !== ($mod = Dog_Module::getByTrigger($argv[0]))) {
$scopetxt = dogplug_scopetxt($plugin, $mod->getPriv($argv[0]), $mod->getScope($argv[0]));
$plugin->reply($mod->getHelp($argv[0]) . $scopetxt);
} else {
Dog::rply('err_command');
}
} else {
$plugin->showHelp();
}
示例13: array
<?php
$lang = array('en' => array('help' => 'Query wechall for user or site info. Usage: %CMD% [<username|rank>] || %CMD% !site <sitename> || %CMD% !sites [<username>] || %CMD% !<sitename> [<username|rank>].'));
$plugin = Dog::getPlugin();
$argv = $plugin->argv();
$argc = count($argv);
switch ($argc) {
case 0:
$argv[0] = Dog::getUser()->getName();
break;
case 1:
if ($argv[0][0] === '!') {
$argv[1] = Dog::getUser()->getName();
}
break;
case 2:
break;
default:
return $plugin->showHelp();
}
$url = 'http://www.wechall.net/wechall.php?username=' . urlencode(implode(' ', $argv));
if (false === ($result = GWF_HTTP::getFromURL($url, false))) {
return Dog::rply('err_repsonse');
}
Dog::reply($result);
示例14: count
$argc = count($argv);
if ($argc === 1) {
$name = $argv[0];
if (false !== ($plug = Dog_Plugin::getPlugWithPerms($serv, $chan, $user, $name))) {
$plug->showConfigVarNames('g');
} elseif (false !== ($mod = Dog_Module::getModuleWithPermsByTrigger($serv, $chan, $user, $name)) || false !== ($mod = Dog_Module::getByName($name))) {
$mod->showConfigVarNames('g');
} else {
Dog::rply('err_command');
}
} elseif ($argc === 2) {
$name = $argv[0];
if (false !== ($plug = Dog_Plugin::getPlugWithPerms($serv, $chan, $user, $name))) {
$plug->showConfigVar('g', $argv[1]);
} elseif (false !== ($mod = Dog_Module::getModuleWithPermsByTrigger($serv, $chan, $user, $name)) || false !== ($mod = Dog_Module::getByName($name))) {
$mod->showConfigVar('g', $argv[1]);
} else {
Dog::rply('err_unk_var');
}
} elseif ($argc === 3) {
$name = $argv[0];
if (false !== ($plug = Dog_Plugin::getPlugWithPerms($serv, $chan, $user, $name))) {
$plug->setConfigVar('g', $argv[1], $argv[2]);
} elseif (false !== ($mod = Dog_Module::getModuleWithPermsByTrigger($serv, $chan, $user, $name)) || false !== ($mod = Dog_Module::getByName($name))) {
$mod->setConfigVar('g', $argv[1], $argv[2]);
} else {
Dog::rply('err_unk_var');
}
} else {
$plugin->showHelp();
}
示例15: foreach
$out = '';
foreach ($vars as $var) {
$var instanceof Dog_Var;
$out .= sprintf(', %s', $var->getName());
}
return $plugin->rply('avail', array(substr($out, 2)));
} elseif ($argc === 1) {
if (false === ($var = Dog_Var::getVar($vars, $argv[0]))) {
return Dog::rply('err_unk_var');
}
$varname = $var->getName();
$vartype = $var->displayType();
$vardeft = $var->getDefault();
$curvalu = Dog_Conf_Bot::getConf($varname, $vardeft);
return $plugin->rply('show', array($varname, $vartype, $vardeft, $curvalu));
} elseif ($argc === 2) {
if (false === ($var = Dog_Var::getVar($vars, $argv[0]))) {
return Dog::rply('err_unk_var');
}
$varname = $var->getName();
$vartype = $var->displayType();
$vardeft = $var->getDefault();
$curvalu = Dog_Conf_Bot::getConf($varname, $vardeft);
if (!Dog_Var::isValid($var->getType(), $argv[1])) {
return $plugin->rply('invalid', array($varname, $vartype));
}
Dog_Conf_Bot::setConf($varname, $argv[1]);
return $plugin->rply('set', array($varname, $argv[1]));
} else {
$plugin->showHelp();
}