我有一个用 PHP 编写的teampeak3 机器人,当我启动机器人时出现此错误:PHP 警告:array_column() 期望参数 1 是数组,给定空值...在第 13 行,第 13 行是 $ clientonchannel,我不知道如何使它工作,感谢一些帮助。我是新手。
PHP Code:
$config['function']['pokeonchannel'] = Array(
'enable' => true,
'info' => Array(
1 => Array(
'channel' => 20,
'pokegroup' => Array(103,110),
'message' => "[NICK] message to user",
)
),
'interval' => Array('days' => 0, 'hours' => 0, 'minutes' => 0, 'seconds' => 30), //interval
'datazero' => '1970-01-01 00:00:00'
);
foreach($config['function']['pokeonchannel']['info'] as $pokeid)
{
$admincount = 0;
$admincount2 = 0;
$clientonchannel = array_keys(array_column($user['data'], 'cid'), $pokeid['channel']); **// This is line 13**
if(isset($clientonchannel[0]))
{
foreach($pokeid['pokegroup'] as $pokegroup)
{
$groupclients = $tsAdmin -> serverGroupClientList($pokegroup, $names = true);
foreach($groupclients['data'] as $clientid)
{
$client = $tsAdmin -> clientFind($clientid['client_nickname']);
if($client['data'])
{
$admin = $tsAdmin-> clientInfo($client['data'][0]['clid']);
if(!in_array($admin['data']['cid'], $config['function']['helpchannel']['ignoredonchannel']))
{
$pokemessage = str_replace('[NICK]', $user['data'][$clientonchannel[0]]['client_nickname'], $pokeid['message']);
$tsAdmin -> clientPoke($client['data'][0]['clid'], $pokemessage);
$admincount++;
}
HUH函数