def channelinfo(self, ctx, channel : discord.Channel = None):
"""Gives you some channel information."""
if channel == None:
channel = ctx.message.channel
passed = (ctx.message.timestamp - channel.created_at).days
try:
channel_created_at = ("Created on {} ({} days ago!)".format(channel.created_at.strftime("%d %b %Y %H:%M"), passed))
em = discord.Embed(description="{}, here you go:".format(ctx.message.author.mention), title="Channel Info", color=0X008CFF)
em.add_field(name="Channel Name", value=str(channel.name))
em.add_field(name="Channel ID", value=str(channel.id))
em.add_field(name="Channel Default", value=str(channel.is_default))
em.add_field(name="Channel Position", value=str(channel.position + 1))
em.add_field(name="Channel Topic", value=(channel.topic))
em.set_footer(text=channel_created_at)
await self.bot.say(embed=em)
except discord.HTTPException:
channel_created_at = ("Created on {} ({} days ago!)".format(channel.created_at.strftime("%d %b %Y %H:%M"), passed))
em = discord.Embed(description="{}, here you go:".format(ctx.message.author.mention), title="Channel Info", color=0X008CFF)
em.add_field(name="Channel Name", value=str(channel.name))
em.add_field(name="Channel ID", value=str(channel.id))
em.add_field(name="Channel Default", value=str(channel.is_default))
em.add_field(name="Channel Position", value=str(channel.position + 1))
em.add_field(name="Channel Topic", value="None")
em.set_footer(text=channel_created_at)
await self.bot.say(embed=em)
评论列表
文章目录