prepare('SELECT c.*, cp.* FROM channels c LEFT JOIN channel_preferences cp ON cp.id = c.id WHERE c.alias_id = ? '); $stmt->execute([$_GET['alias_id']]); $channel = $stmt->fetch(PDO::FETCH_ASSOC) ?: null; if (!isset($channel)) { http_response_code(404); exit; } // fetching custom commands $stmt = $db->prepare('SELECT * FROM custom_commands WHERE channel_id = ? '); $stmt->execute([$channel['id']]); $channel['commands'] = $stmt->fetchAll(PDO::FETCH_ASSOC); // fetching timers $stmt = $db->prepare('SELECT * FROM timers WHERE channel_id = ? '); $stmt->execute([$channel['id']]); $channel['timers'] = $stmt->fetchAll(PDO::FETCH_ASSOC); // fetching events $stmt = $db->prepare('SELECT e.*, COUNT(es.id) as subscription_count FROM events e LEFT JOIN event_subscriptions es ON es.event_id = e.id WHERE e.channel_id = ? GROUP BY e.id ORDER BY subscription_count DESC '); $stmt->execute([$channel['id']]); $channel['events'] = $stmt->fetchAll(PDO::FETCH_ASSOC); // fetching event names $twitch_types = [0, 1, 2, 3, 8, 10, 11, 12, 13, 14, 15]; $twitch_channel_ids = []; $kick_types = [4, 5, 6, 7]; $kick_channel_ids = []; foreach ($channel['events'] as &$e) { if (in_array($e['event_type'], $twitch_types)) { array_push($twitch_channel_ids, $e['name']); } else if (in_array($e['event_type'], $kick_types)) { array_push($kick_channel_ids, $e['name']); } $e['event_type_translated'] = match ($e['event_type']) { 0 => 'Live (Twitch)', 1 => 'Offline (Twitch)', 2 => 'Title change (Twitch)', 3 => 'Game change (Twitch)', 4 => 'Live (Kick)', 5 => 'Offline (Kick)', 6 => 'Title change (Kick)', 7 => 'Game change (Kick)', 8 => 'Chat message (Twitch)', 10 => 'Emote creation (7TV)', 11 => 'Emote deletion (7TV)', 12 => 'Emote update (7TV)', 13 => 'Emote creation (BTTV)', 14 => 'Emote deletion (BTTV)', 15 => 'Emote update (BTTV)', 40 => 'GitHub', default => 'Custom' }; } unset($e); if (!empty($twitch_channel_ids)) { $event_users = get_twitch_users(implode('&id=', $twitch_channel_ids)); foreach ($event_users as $user) { foreach ($channel['events'] as &$e) { if ($e['name'] == $user['id']) { $e['name'] = $user['login']; } } unset($e); } } if (!empty($kick_channel_ids)) { $event_users = get_kick_users(implode('&broadcaster_user_id=', $kick_channel_ids)); foreach ($event_users as $user) { foreach ($channel['events'] as &$e) { if ($e['name'] == $user['broadcaster_user_id']) { $e['name'] = $user['slug']; } } unset($e); } } if ($response = get_twitch_users($channel['alias_id'])) { $user = $response[0]; $channel['pfp'] = $user['profile_image_url']; $channel['description'] = $user['description'] ?: null; } $has_content = !empty($channel['events']) || !empty($channel['commands']) || !empty($channel['timers']); } else if (!SHOW_CHANNEL_LIST) { http_response_code(403); exit; } else { $stmt = $db->query('SELECT c.alias_id, c.alias_name FROM channels c INNER JOIN channel_preferences cp ON cp.id = c.id WHERE c.opted_out_at IS NULL AND cp.silent_mode = FALSE ORDER BY c.joined_at DESC'); $stmt->execute(); $channels = $stmt->fetchAll(PDO::FETCH_ASSOC) ?: []; } // fetching user pfps if (!empty($channels)) { $channel_ids = []; foreach ($channels as $c) { array_push($channel_ids, $c['alias_id']); } $response = get_twitch_users(implode('&id=', $channel_ids)); if (!empty($response)) { foreach ($response as $c) { $index = array_search($c['id'], array_column($channels, 'alias_id')); $channels[$index]['pfp'] = $c['profile_image_url']; } } } ?> <?php if ($channel): ?> <?= $channel['alias_name'] ?> <?php else: ?> Channels <?php endif; ?> - <?= BOT_USERNAME_FORMATTED ?>

About

Language:

Prefix:

Silent mode

Joined ago

Opted out!

Events


Name Type Message Massping Subscribers

Custom commands


Name Message

Timers


Name Message Interval Last executed
ago

Nothing found...

No one has joined yet... ;(

Be the first one!

channels have already joined us

Check out the !join command to participate!