Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import discord
- from discord.ext import commands
- client = commands.Bot(command_prefix="!", intents=discord.Intents.all())
- @client.event
- async def on_ready():
- await client.tree.sync()
- print("Success: Bot is connected to discord.")
- @client.command()
- async def serverinfo(ctx):
- info_embed = discord.Embed(title=f"Information about {ctx.guild.name}", description="All public information about this guild.", color=discord.Color.dark_blue())
- info_embed.set_thumbnail(url=ctx.guild.icon)
- info_embed.add_field(name="Name: ", value=ctx.guild.name, inline=False)
- info_embed.add_field(name="ID: ", value=ctx.guild.id, inline=False)
- info_embed.add_field(name="Owner: ", value=ctx.guild.owner.mention, inline=False)
- info_embed.add_field(name="Member Count: ", value=ctx.guild.member_count, inline=False)
- info_embed.add_field(name="Channel Count: ", value=len(ctx.guild.channels), inline=False)
- info_embed.add_field(name="Role Count: ", value=len(ctx.guild.roles), inline=False)
- info_embed.add_field(name="Rules Channel: ", value=ctx.guild.rules_channel, inline=False)
- info_embed.add_field(name="Booster Count: ", value=ctx.guild.premium_subscription_count, inline=False)
- info_embed.add_field(name="Booster Tier: ", value=ctx.guild.premium_tier, inline=False)
- info_embed.add_field(name="Booster Role: ", value=ctx.guild.premium_subscriber_role, inline=False)
- info_embed.add_field(name="Date of Creation: ", value=ctx.guild.created_at.__format__("%A, %d. %B %Y @ %H:%M:%S"), inline=False)
- info_embed.set_footer(text=f"Requested By: {ctx.author.name}", icon_url=ctx.author.avatar)
- await ctx.send(embed=info_embed)
- client.run("Your Bot Token") # Replace “Your Bot Token With The Actual Bot Token”
- # Need Help? Join Our Discord - https://discord.gg/tutorial
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement