Added command to list bots that are claimed by user

This commit is contained in:
Dustin Pianalto 2018-06-14 10:50:27 -08:00
parent 9dd3a349ca
commit 885c6f9309

View File

@ -89,6 +89,21 @@ class BotManager:
f'{ctx.prefix}claim {bot.mention} {existing["prefix"]}' f'{ctx.prefix}claim {bot.mention} {existing["prefix"]}'
await ctx.send(embed=em) await ctx.send(embed=em)
@commands.command(name='listclaims', aliases=['claimed', 'mybots'])
@commands.cooldown(1, 5, commands.BucketType.user)
async def _claimed_bots(self, ctx):
bots = await self.bot.db_con.fetch('select * from bots where owner = $1', ctx.author.id)
if bots:
em = discord.Embed(title='You have claimed the following bots:',
colour=self.bot.embed_color)
for bot in bots:
member = ctx.guild.get_member(int(bot['id']))
em.add_field(name=member.display_name, value=f'Stored Prefix: {bot["prefix"]}', inline=False)
else:
em = discord.Embed(title='You have not claimed any bots.',
colour=self.bot.embed_color)
await ctx.send(embed=em)
def setup(bot): def setup(bot):
bot.add_cog(BotManager(bot)) bot.add_cog(BotManager(bot))