test 1.2 de la récupération de pp discord sur site web

This commit is contained in:
Aboubacar M'houmadi 2026-02-08 22:29:12 +01:00
parent 6c0512972d
commit 5d0d451753

View file

@ -55,25 +55,25 @@ def setup_routes(app, bot):
"description": guild.description if guild.description else None, "description": guild.description if guild.description else None,
"features": list(guild.features) if guild.features else [], "features": list(guild.features) if guild.features else [],
"created_at": guild.created_at.isoformat() if guild.created_at else None, "created_at": guild.created_at.isoformat() if guild.created_at else None,
"channels": [ # "channels": [
{ # {
"id": channel.id, # "id": channel.id,
"name": channel.name, # "name": channel.name,
"type": str(channel.type), # "type": str(channel.type),
"category": channel.category.name if channel.category else None # "category": channel.category.name if channel.category else None
} # }
for channel in guild.channels # for channel in guild.channels
], # ],
"roles": [ # "roles": [
{ # {
"id": role.id, # "id": role.id,
"name": role.name, # "name": role.name,
"color": role.color, # "color": role.color,
"position": role.position, # "position": role.position,
"member_count": len(role.members) # "member_count": len(role.members)
} # }
for role in guild.roles # for role in guild.roles
] # ]
}) })
@app.route("/api/status") @app.route("/api/status")
@ -85,7 +85,7 @@ def setup_routes(app, bot):
"user_id": bot.user.id if bot.user else None, "user_id": bot.user.id if bot.user else None,
"guild_count": len(bot.guilds), "guild_count": len(bot.guilds),
"total_members": sum(guild.member_count for guild in bot.guilds) if bot.guilds else 0, "total_members": sum(guild.member_count for guild in bot.guilds) if bot.guilds else 0,
"total_channels": sum(len(guild.channels) for guild in bot.guilds) if bot.guilds else 0, # "total_channels": sum(len(guild.channels) for guild in bot.guilds) if bot.guilds else 0,
"uptime": "N/A", # TODO: Implement uptime tracking "uptime": "N/A", # TODO: Implement uptime tracking
"version": "2.0.0", "version": "2.0.0",
"api_endpoints": [ "api_endpoints": [