From e0dca77976bb99d4aa5a6d616452cafede17297f Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Thu, 23 Mar 2017 15:18:02 -0400 Subject: [PATCH] chanel count, user count --- bot.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/bot.php b/bot.php index dd01da7..ff796d0 100644 --- a/bot.php +++ b/bot.php @@ -37,7 +37,8 @@ $discord = new DiscordCommandClient([ 'defaultHelpCommand' => false, 'name' => 'benbot', 'discordOptions' => [ - 'pmChannels' => true, + 'pmChannels' => true, + 'loadAllMembers' => true, ], ]); @@ -849,12 +850,17 @@ $discord->registerCommand('sys', function($msg, $args) { ]); /////////////////////////////////////////////////////////// $discord->registerCommand('status', function($msg, $args) use ($discord, $starttime) { + $usercount = 0; + foreach ($discord->guilds as $guild) { + $usercount += $guild->member_count; + } $embed = $discord->factory(Embed::class, [ 'title' => 'Benbot status', 'thumbnail' => ['url' => $discord->avatar], 'fields' => [ ['name' => 'Uptime', 'value' => $starttime->diffForHumans(Carbon::now(), true) . " (since " . $starttime->format('g:i A \o\n l F j, Y') . ")"], ['name' => 'Server Count', 'value' => count($discord->guilds)], + ['name' => 'User Count', 'value' => $usercount], ], 'timestamp' => null, ]); @@ -891,6 +897,10 @@ $discord->registerCommand('server', function($msg, $args) use ($discord) { 'name' => 'Member Count', 'value' => $guild->member_count, ], + [ + 'name' => 'Channel Count', + 'value' => count($guild->channels), + ], [ 'name' => 'Region', 'value' => $guild->region,