Example #1
0
    async def serverinfo(self, ctx, server_id: Union[discord.Guild, int] = None):
        """SERVERINFO_HELP"""
        if server_id is None:
            guild = ctx.guild
        else:
            guild = self.bot.get_guild(server_id)

        if guild is None:
            return await ctx.send(Translator.translate('SERVERINFO_NOT_FOUND', ctx, id=str(server_id)))

        guild_features = "\n".join(guild.features) if len(guild.features) > 0 else None
        guild_emojis = " ".join(walk_emojis(guild.emojis))

        embed = DefraEmbed(title=f"{guild.name}")
        embed.set_thumbnail(url=guild.icon_url)
        embed.add_field(name="**ID**", value=str(guild.id), inline=False)
        embed.add_field(name=Translator.translate("SERVERINFO_OWNER", ctx), value=str(guild.owner), inline=False)
        embed.add_field(name=Translator.translate("SERVERINFO_MEMBERS", ctx), value=str(guild.member_count), inline=False)

        if guild_features is not None:
            embed.add_field(name=Translator.translate("SERVERINFO_FEATURES", ctx), value=guild_features, inline=False)

        embed.add_field(name=Translator.translate("SERVERINFO_EMOJILIST", ctx), value=guild_emojis[0:1000], inline=False)

        await ctx.send(embed=embed)
Example #2
0
 async def about(self, ctx):
     """ABOUT_TITLE"""
     e = DefraEmbed(
         title=Translator.translate("ABOUT_TITLE", ctx),
         footer_text=Translator.translate("ABOUT_FOOTER", ctx, user=ctx.author),
         footer_icon_url=ctx.author.avatar_url,
         description=Translator.translate('ABOUT_DESCRIPTION', ctx, owner=self.bot.owner, lib_version=f"discord.py {discord.__version__}")
     )
     e.set_thumbnail(url=self.bot.user.avatar_url_as(format="png"))
     await ctx.send(embed=e)