summaryrefslogtreecommitdiff
path: root/main.py
diff options
context:
space:
mode:
authorromangraef <roman.graef@gmail.com>2018-05-01 20:46:11 +0200
committerromangraef <roman.graef@gmail.com>2018-05-01 20:46:11 +0200
commita7d40ea53898c3033e7e20ea9b2d92b2ecb947b5 (patch)
tree8869dcf81ce173e21496be401f08ce3b5c9d51af /main.py
parent09159438993ed445b9b8a04cb2b171cd5027308c (diff)
downloadfuckingselfbot-a7d40ea53898c3033e7e20ea9b2d92b2ecb947b5.tar.gz
fuckingselfbot-a7d40ea53898c3033e7e20ea9b2d92b2ecb947b5.tar.bz2
fuckingselfbot-a7d40ea53898c3033e7e20ea9b2d92b2ecb947b5.zip
added `~channel` command
Diffstat (limited to 'main.py')
-rw-r--r--main.py24
1 files changed, 23 insertions, 1 deletions
diff --git a/main.py b/main.py
index f736109..942c774 100644
--- a/main.py
+++ b/main.py
@@ -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: