# Method: stats.getMegagroupStats

Back to methods index

Get supergroup statistics

# Parameters:

Name Type Description Required
dark Bool Whether to enable dark theme for graph colors Optional
channel Username, chat ID, Update, Message or InputChannel Supergroup ID Optional

# Return type: stats.MegagroupStats

# Can bots use this method: NO

# MadelineProto Example (now async for huge speed and parallelism!):

if (!file_exists('madeline.php')) {
    copy('https://phar.madelineproto.xyz/madeline.php', 'madeline.php');
include 'madeline.php';

$MadelineProto = new \danog\MadelineProto\API('session.madeline');

$stats_MegagroupStats = $MadelineProto->stats->getMegagroupStats(['dark' => Bool, 'channel' => InputChannel, ]);

Or, if you’re into Lua:

stats_MegagroupStats = stats.getMegagroupStats({dark=Bool, channel=InputChannel, })

# Errors

Code Type Description
400 CHAT_ADMIN_REQUIRED You must be an admin in this chat to do this
400 MEGAGROUP_REQUIRED You can only use this method on a supergroup
This site uses cookies, as described in the cookie policy. By clicking on "Accept" you consent to the use of cookies.