Merge remote-tracking branch 'origin/development' into development

# Conflicts:
#	src/cogs/bot_management.py
This commit is contained in:
Dustin Pianalto 2018-06-18 10:30:37 -08:00
commit 3d508968d4

View File

@ -7,7 +7,7 @@ class BotManager:
self.bot = bot
@commands.command()
async def invite(self, ctx, bot_id: discord.Member = None, prefix=None):
async def invite(self, ctx, bot_id :discord.Member = None, prefix = None):
if not bot_id:
raise Warning('You must include the id of the bot you are trying to invite... Be exact.')
if not bot_id.bot:
@ -15,24 +15,22 @@ class BotManager:
if not prefix:
raise Warning('Please provide a prefix')
em = discord.Embed(colour=self.bot.embed_color)
em = discord.Embed(colour = self.bot.embed_color)
em.title = "Hello {},".format(ctx.author.name)
em.description = "Thanks for inviting your bot! It will be tested and invited shortly. " \
"Please open your DMs if they are not already so the bot can contact " \
"you to inform you about the progress of the bot!"
await ctx.send(embed=em)
em.description = "Thanks for inviting your bot! It will be tested and invited shortly. Please open your DMs if they are not already so the bot can contact you to inform you about the progress of the bot!"
await ctx.send(embed = em)
em = discord.Embed(title="Bot invite", colour=discord.Color(0x363941))
em = discord.Embed(title = "Bot invite", colour=discord.Color(0x363941))
em.set_thumbnail(url=bot_id.avatar_url)
em.add_field(name="Bot name", value=bot_id.name)
em.add_field(name="Bot id", value="`" + str(bot_id.id) + "`")
em.add_field(name="Bot owner", value=ctx.author.mention)
em.add_field(name="Bot prefix", value="`" + prefix + "`")
await ctx.bot.get_channel(448803675574370304).send(embed=em)
await ctx.bot.get_channel(448803675574370304).send(embed = em)
@commands.command(name='claim', aliases=['makemine', 'gimme'])
@commands.cooldown(1, 5, commands.BucketType.user)
async def _claim_bot(self, ctx, bot: discord.Member=None, prefix: str=None, owner: discord.Member =None):
async def _claim_bot(self, ctx, bot: discord.Member=None, prefix: str=None, owner : discord.Member =None):
if not bot:
raise Warning('You must include the name of the bot you are trying to claim... Be exact.')
if not bot.bot:
@ -43,10 +41,11 @@ class BotManager:
else:
raise Warning('Prefix not provided and can\'t be found in bot name.')
if owner is not None and ctx.author.guild_permissions.manage_guild:
if owner != None and ctx.author.guild_permissions.manage_roles:
author_id = owner.id
else:
author_id = ctx.author.id
em = discord.Embed()
if await self.bot.db_con.fetchval('select count(*) from bots where owner = $1', author_id) >= 10:
@ -105,7 +104,7 @@ class BotManager:
em.colour = self.bot.error_color
em.title = 'Bot Not Found'
em.description = 'That bot is not claimed'
elif existing['owner'] != ctx.author.id and ctx.author.guild_permissions.manage_guild:
elif existing['owner'] != ctx.author.id and not ctx.author.guild_permissions.manage_roles:
em.colour = self.bot.error_color
em.title = 'Not Claimed By You'
em.description = 'That bot is claimed by someone else.\n' \
@ -145,5 +144,6 @@ class BotManager:
await ctx.send(ctx.guild.get_member(owner['owner']).display_name)
def setup(bot):
bot.add_cog(BotManager(bot))