Updating commands description

Adding channelinfo command
pull/8/head
sgoudham 4 years ago
parent d564c1f0e6
commit be6a0faa5f

@ -64,7 +64,7 @@ class Info(commands.Cog):
@command(name="userinfo", aliases=["ui"]) @command(name="userinfo", aliases=["ui"])
@cooldown(1, 5, BucketType.user) @cooldown(1, 5, BucketType.user)
async def user_info(self, ctx, target=None): async def user_info(self, ctx, target=None):
"""Allow the users to see information about them relating to the guild""" """User Information! (Created At/Joined/Roles etc)"""
# If a target has been specified, set them as the user # If a target has been specified, set them as the user
if target: if target:
@ -120,7 +120,7 @@ class Info(commands.Cog):
@command(name="serverinfo", aliases=["guildinfo"]) @command(name="serverinfo", aliases=["guildinfo"])
@cooldown(1, 5, BucketType.user) @cooldown(1, 5, BucketType.user)
async def server_info(self, ctx): async def server_info(self, ctx):
"""Allow the users to see information the guild itself""" """Guild Information! (Owner/Roles/Emojis etc)"""
# Define guild icon and id # Define guild icon and id
guild_icon = ctx.guild.icon_url guild_icon = ctx.guild.icon_url
@ -207,9 +207,42 @@ class Info(commands.Cog):
# Send the embed to the channel that the command was triggered in # Send the embed to the channel that the command was triggered in
await ctx.send(embed=embed) await ctx.send(embed=embed)
@command(name="channelinfo", aliases=["chinfo"])
@cooldown(1, 5, BucketType.user)
async def channel_info(self, ctx):
"""Channel Statistics! (Category/Created At etc)"""
# Get the channel that the user is in
channel = ctx.channel
# Set up Embed
embed = Embed(title=f"Statistics For **{string.capwords(channel.name.capitalize())}**",
description=f"{'Category: {}'.format(channel.category.name) if channel.category else 'N/A'}",
timestamp=datetime.datetime.utcnow(),
colur=Colour(int(random.choice(colour_list))))
embed.set_thumbnail(url=ctx.guild.icon_url)
embed.set_footer(text=f"ID: {channel.id}")
# Setting up fields
fields = [
("Guild", ctx.guild.name, True),
("Creation At", channel.created_at, True),
("Topic", f"{channel.topic if channel.topic else 'No Topic'}", True),
("Permissions Synced?", channel.permissions_synced, True),
("Position", channel.position, True),
("NSFW?", channel.is_nsfw(), True)
]
# Add fields to the embed
for name, value, inline in fields:
embed.add_field(name=name, value=value, inline=inline)
await ctx.send(embed=embed)
@command(name="stats") @command(name="stats")
@cooldown(1, 5, BucketType.user)
async def checking_bot_stats(self, ctx): async def checking_bot_stats(self, ctx):
"""Bot Statistics (CPU/Mem Usage etc)""" """Bot Statistics! (CPU/Mem Usage etc)"""
stats = Embed(title="Bot Stats", stats = Embed(title="Bot Stats",
colour=enso_embedmod_colours, colour=enso_embedmod_colours,

Loading…
Cancel
Save