From 6007237f10d8c4e588984eb6d7e8324fe5168a8a Mon Sep 17 00:00:00 2001 From: Phxntxm Date: Sat, 11 Mar 2017 21:35:56 -0600 Subject: [PATCH] Added a da list command --- cogs/da.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/cogs/da.py b/cogs/da.py index e5ca7be..66e25d1 100644 --- a/cogs/da.py +++ b/cogs/da.py @@ -140,7 +140,7 @@ class Deviantart: else: await ctx.send("You are already subscribed to that user!") - @da.command(pass_context=True, name='unsub', aliases=['delete', 'remove', 'unsubscribe']) + @da.command(name='unsub', aliases=['delete', 'remove', 'unsubscribe']) @utils.custom_perms(send_messages=True) async def da_unsub(self, ctx, *, username): """This command can be used to unsub from the specified user @@ -159,6 +159,23 @@ class Deviantart: else: await ctx.send("You are not subscribed to that user!") + @da.command(name='list') + @utils.custom_perms(send_messages=True) + async def da_list(self, ctx): + """Lists the artists you are subscribed to on DA + + EXAMPLE: !da list + RESULT: Artist 1, Artist2, Artist 3""" + + key = str(ctx.message.author.id) + content = await utils.get_content('deviantart', key) + + if content is None or content['subbed'] is None: + await ctx.send("You are not subscribed to anyone at the moment!") + else: + fmt = ", ".join(content['subbed']) + await ctx.send("You are subscribed to:\n\n{}".format(fmt)) + def setup(bot): bot.add_cog(Deviantart(bot))