Answers for "python discord py make embed"

9

python discord py make embed

def server(self, ctx):
        """Shows server info"""

        server = ctx.message.server

        roles = str(len(server.roles))
        emojis = str(len(server.emojis))
        channels = str(len(server.channels))

        embeded = discord.Embed(title=server.name, description='Server Info', color=0xEE8700)
        embeded.set_thumbnail(url=server.icon_url)
        embeded.add_field(name="Created on:", value=server.created_at.strftime('%d %B %Y at %H:%M UTC+3'), inline=False)
        embeded.add_field(name="Server ID:", value=server.id, inline=False)
        embeded.add_field(name="Users on server:", value=server.member_count, inline=True)
        embeded.add_field(name="Server owner:", value=server.owner, inline=True)

        embeded.add_field(name="Default Channel:", value=server.default_channel, inline=True)
        embeded.add_field(name="Server Region:", value=server.region, inline=True)
        embeded.add_field(name="Verification Level:", value=server.verification_level, inline=True)

        embeded.add_field(name="Role Count:", value=roles, inline=True)
        embeded.add_field(name="Emoji Count:", value=emojis, inline=True)
        embeded.add_field(name="Channel Count:", value=channels, inline=True)

        await self.bot.say(embed=embeded)
Posted by: Guest on March-26-2020
1

python discord py make embed

def userinfo(self, ctx, *, user: discord.Member = None):
        """
        Get information about you, or a specified user.

        `user`: The user who you want information about. Can be an ID, mention or name.
        """

        if user is None:
            user = ctx.author

        embed = discord.Embed(
            colour=utils.user_colour(user),
            title=f"{user.name}'s Stats and Information."
        )
        embed.set_footer(text=f"ID: {user.id}")
        embed.set_thumbnail(url=user.avatar_url_as(format="png"))
        embed.add_field(name="__**General information:**__", value=f"**Discord Name:** {user}\n"
                                                                   f"**Account created:** {user.created_at.__format__('%A %d %B %Y at %H:%M')}\n"
                                                                   f"**Status:** {utils.user_status(user)}\n"
                                                                   f"**Activity:** {utils.user_activity(user)}", inline=False)
        embed.add_field(name="__**Server-related information:**__", value=f"**Nickname:** {user.nick}\n"
                                                                          f"**Joined server:** {user.joined_at.__format__('%A %d %B %Y at %H:%M')}\n"
                                                                          f"**Roles:** {' '.join([r.mention for r in user.roles[1:]])}")
        return await ctx.send(embed=embed)
Posted by: Guest on March-26-2020
1

send embed discord.py

@client.event
async def on_message(message):
    if message.content.startswith('!hello'):
        embedVar = discord.Embed(title="Title", description="Desc", color=0x00ff00)
        embedVar.add_field(name="Field1", value="hi", inline=False)
        embedVar.add_field(name="Field2", value="hi2", inline=False)
        await message.channel.send(embed=embedVar)
Posted by: Guest on June-21-2021
0

embed python discord

embed.set_thumbnail(url="https://i.imgur.com/axLm3p6.jpeg")
Posted by: Guest on April-07-2021

Python Answers by Framework

Browse Popular Code Answers by Language