diff options
author | romangraef <roman.graef@gmail.com> | 2018-05-01 20:46:11 +0200 |
---|---|---|
committer | romangraef <roman.graef@gmail.com> | 2018-05-01 20:46:11 +0200 |
commit | a7d40ea53898c3033e7e20ea9b2d92b2ecb947b5 (patch) | |
tree | 8869dcf81ce173e21496be401f08ce3b5c9d51af | |
parent | 09159438993ed445b9b8a04cb2b171cd5027308c (diff) | |
download | fuckingselfbot-a7d40ea53898c3033e7e20ea9b2d92b2ecb947b5.tar.gz fuckingselfbot-a7d40ea53898c3033e7e20ea9b2d92b2ecb947b5.tar.bz2 fuckingselfbot-a7d40ea53898c3033e7e20ea9b2d92b2ecb947b5.zip |
added `~channel` command
-rw-r--r-- | main.py | 24 |
1 files changed, 23 insertions, 1 deletions
@@ -64,6 +64,28 @@ def get_with_attr(arr, **attributes): return list(_get_with_attr()) +@bot.command(name="channel", pass_context=True) +@check_guild +async def channel_cmd(ctx: commands.Context, channel: discord.TextChannel = None): + if channel is None: + channel = ctx.channel + category: discord.CategoryChannel = channel.category + + embed = discord.Embed( + title='Channel: %s' % channel.name, + description=channel.topic, + color=discord.Color.blurple()) + + embed.add_field(name="Created at", value=channel.created_at) + embed.add_field(name="Id", value=channel.id) + embed.add_field(name="Category", value="%s (%s)" % (category.name, category.id)) + embed.add_field(name="Position", value=channel.position) + embed.add_field(name="Changed roles", value=', '.join(role.mention for role in channel.changed_roles)) + + await ctx.send(embed=embed) + await ctx.react('✅') + + @bot.command(name="user", pass_context=True) @check_guild async def user_cmd(ctx: commands.Context, identifier): @@ -127,7 +149,7 @@ async def role_cmd(ctx: commands.Context): @bot.command(pass_context=True) @check_guild -async def raw(ctx: commands.Context, id, quiet: bool=True): +async def raw(ctx: commands.Context, id, quiet: bool = True): channel: discord.TextChannel = ctx.channel async for mes in channel.history(limit=2, around=Object(id=id)): if str(mes.id) == id: |