def guild(self, ctx, guild_id: int):
"""
Searchs for a guild via ID
"""
try:
with ctx.channel.typing():
guild = self.bot.get_guild(guild_id)
if guild is None:
raise discord.NotFound
embed = discord.Embed(colour=discord.Colour(0x30f9c7), description=f"ID: {guild.id}",
timestamp=datetime.datetime.now())
embed.set_thumbnail(
url=guild.icon_url)
embed.set_author(name=guild.name)
embed.set_footer(text="Who Is: Guild")
embed.add_field(name="Members", value=str(len(guild.members)))
embed.add_field(name="Roles", value=str(len(guild.roles) - 1))
embed.add_field(name="Channels", value=str(len(guild.channels)))
embed.add_field(name="AFK Channel", value=guild.afk_channel)
embed.add_field(name="AFK Timeout", value=str(guild.afk_timeout / 60))
embed.add_field(name="Owner", value=guild.owner)
embed.add_field(name="Creation Date", value=guild.created_at)
embed.add_field(name="Region", value=guild.region)
embed.add_field(name="Verification Level", value=guild.verification_level)
await ctx.send(embed=embed)
except discord.NotFound:
await ctx.send("`No guild found under this ID`")
except discord.HTTPException:
await ctx.send("`Error collecting guild information`")
return
评论列表
文章目录