@@ -318,6 +318,54 @@ async def nuke(self, ctx: ApplicationContext, channel: discord.TextChannel):
318
318
await new_channel .send (f"Channel nuked by **{ ctx .author .name } **!" )
319
319
await ctx .respond (embed = localembed , ephemeral = True )
320
320
321
+ @commands .slash_command (
322
+ name = "serverinfo" ,
323
+ description = "Get detailed information about the server."
324
+ )
325
+ @commands .guild_only ()
326
+ async def serverinfo (self , ctx : ApplicationContext ):
327
+ """Get detailed information about the server."""
328
+ localembed = discord .Embed (
329
+ title = f"Server info on **{ ctx .guild .name } **" ,
330
+ description = f"*{ ctx .guild .description } *" if ctx .guild .description is not None else '' ,
331
+ color = discord .Color .random ()
332
+ )
333
+ localembed .set_thumbnail (url = ctx .guild .icon )
334
+ localembed .set_footer (text = f"Server ID: { ctx .guild .id } " )
335
+ if ctx .guild .banner is not None :
336
+ localembed .set_image (url = ctx .guild .banner )
337
+
338
+ # Server Info Fields
339
+ localembed .add_field (name = "Server Created On" , value = ctx .guild .created_at .strftime ("%b %d, %Y, %T" ))
340
+ localembed .add_field (name = "Member Count" , value = f"{ ctx .guild .member_count } members" )
341
+ localembed .add_field (name = "Server Owner" , value = f"<@!{ ctx .guild .owner_id } >" )
342
+ localembed .add_field (
343
+ name = "Total Number of Channels" ,
344
+ value = f"{ len (ctx .guild .channels )- len (ctx .guild .categories )} channels\n ({ len (ctx .guild .text_channels )} Text | { len (ctx .guild .voice_channels )} Voice | { len (ctx .guild .forum_channels )} Forums)" ,
345
+ inline = True
346
+ )
347
+ localembed .add_field (name = "Total Number of Roles" , value = f"{ len (ctx .guild .roles )- 1 } roles" )
348
+ threads = await ctx .guild .active_threads ()
349
+ threads_display_list = str ()
350
+ if len (threads ) <= 4 : # Display threads if total threads count is under 5
351
+ for thread in threads :
352
+ threads_display_list += f"<#{ thread .id } >, "
353
+ threads_display_list = threads_display_list .rstrip (", " ) # Removing the final "," from the string
354
+ localembed .add_field (
355
+ name = "Currently Active Threads" ,
356
+ value = f"{ len (await ctx .guild .active_threads ())} threads { f'({ threads_display_list } )' if threads_display_list != '' else '' } "
357
+ )
358
+ localembed .add_field (
359
+ name = "Active Invite Links" ,
360
+ value = f"{ len (await ctx .guild .invites ())} links { '(invites disabled)' if ctx .guild .invites_disabled else '' } "
361
+ )
362
+ localembed .add_field (name = "Server Verification Level" , value = ctx .guild .verification_level , inline = True )
363
+ localembed .add_field (
364
+ name = "Custom Expressions (emojis/stickers)" ,
365
+ value = f"{ len (await ctx .guild .fetch_emojis ())} emojis | { len (await ctx .guild .fetch_stickers ())} stickers"
366
+ )
367
+ await ctx .respond (embed = localembed )
368
+
321
369
commandmanager = SlashCommandGroup ("commandmanager" , "Manage isobot's command registry." )
322
370
323
371
@commandmanager .command (
0 commit comments