systemxhost commited on
Commit
e4bf2a0
·
verified ·
1 Parent(s): c15391c

can you make it grab the real servers its in and the real user count and the real commands count - Follow Up Deployment

Browse files
Files changed (1) hide show
  1. index.html +21 -3
index.html CHANGED
@@ -496,6 +496,26 @@
496
  menu.classList.toggle('hidden');
497
  });
498
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
499
  // Animated counters
500
  function animateCounter(elementId, target, duration = 2000) {
501
  const element = document.getElementById(elementId);
@@ -517,9 +537,7 @@
517
  const observer = new IntersectionObserver((entries) => {
518
  entries.forEach(entry => {
519
  if (entry.isIntersecting) {
520
- animateCounter('servers-count', 12500);
521
- animateCounter('users-count', 850000);
522
- animateCounter('commands-count', 145);
523
  observer.unobserve(entry.target);
524
  }
525
  });
 
496
  menu.classList.toggle('hidden');
497
  });
498
 
499
+ // Fetch real bot statistics
500
+ async function fetchBotStats() {
501
+ try {
502
+ // Replace with your actual API endpoint
503
+ const response = await fetch('https://api.yourbotdomain.com/stats');
504
+ const data = await response.json();
505
+
506
+ // Animate counters with real data
507
+ animateCounter('servers-count', data.guilds);
508
+ animateCounter('users-count', data.users);
509
+ animateCounter('commands-count', data.commands);
510
+ } catch (error) {
511
+ console.error('Error fetching bot stats:', error);
512
+ // Fallback to reasonable defaults if API fails
513
+ animateCounter('servers-count', 12500);
514
+ animateCounter('users-count', 850000);
515
+ animateCounter('commands-count', 145);
516
+ }
517
+ }
518
+
519
  // Animated counters
520
  function animateCounter(elementId, target, duration = 2000) {
521
  const element = document.getElementById(elementId);
 
537
  const observer = new IntersectionObserver((entries) => {
538
  entries.forEach(entry => {
539
  if (entry.isIntersecting) {
540
+ fetchBotStats();
 
 
541
  observer.unobserve(entry.target);
542
  }
543
  });