async def mc_block(self,ctx,*,value='help'): """Get infos about any block""" if value=='help': await ctx.send(await self.translate(ctx.channel,"mc","block-help")) return try: Block = frmc_lib.main(value,'Bloc') except: await ctx.send(await self.translate(ctx.channel,"mc","no-block")) return title = "{} - {}".format((await self.translate(ctx.channel,"mc","names"))[0],Block.Name) embed = self.bot.get_cog("EmbedCog").Embed(title=title, color=discord.Colour(int('16BD06',16)), url=Block.Url, time=ctx.message.created_at, desc=await self.translate(ctx.channel,'mc','contact-mail'), thumbnail=Block.Image) await embed.create_footer(ctx) embed.add_field(name="Nom", value=Block.Name,inline=False) l = ("\n".join(Block.ID),Block.Stack,Block.CreativeTab,Block.Damage,Block.Strength,Block.Tool,", ".join(Block.Mobs),Block.Version) for e,v in enumerate(await self.translate(ctx.channel,"mc","block-fields")): if l[e] not in [None,'']: try: embed.add_field(name=v, value=l[e]) except: pass try: await ctx.send(embed=embed) except Exception as e: await self.bot.cogs['ErrorsCog'].on_error(e,ctx) await ctx.send(await self.translate(ctx.channel,"mc","no-entity"))
async def mc_advc(self,ctx,*,value='help'): """Get infos about any advancement""" if value=='help': await ctx.send(await self.translate(ctx.channel,"mc","adv-help")) return try: Adv = frmc_lib.main(value,'Progrès') except: await ctx.send(await self.translate(ctx.channel,"mc","no-adv")) return title = "{} - {}".format((await self.translate(ctx.channel,"mc","names"))[4],Adv.Name) embed = self.bot.get_cog("EmbedCog").Embed(title=title, color=discord.Colour(int('16BD06',16)), url=Adv.Url, time=ctx.message.created_at, desc=await self.translate(ctx.channel,'mc','contact-mail')) await embed.create_footer(ctx) if Adv.Image != None: embed.thumbnail(url=Adv.Image) l = (Adv.Name,Adv.ID,Adv.Type,Adv.Action,Adv.Parent,", ".join(Adv.Children),Adv.Version) #("Nom","Identifiant","Type","Action","Parent","Enfants","Version d'ajout") for e,v in enumerate(await self.translate(ctx.channel,"mc","adv-fields")): if l[e] not in [None,'']: try: embed.add_field(name=v, value=l[e]) except: pass try: await ctx.send(embed=embed) except Exception as e: await self.bot.cogs['ErrorsCog'].on_error(e,ctx) await ctx.send(await self.translate(ctx.channel,"mc","no-adv"))
async def mc_item(self,ctx,*,value='help'): """Get infos about any item""" if value=='help': await ctx.send(await self.translate(ctx.channel,"mc","item-help")) return try: Item = frmc_lib.main(value,"Item") except: await ctx.send(await self.translate(ctx.channel,"mc","no-item")) return title = "{} - {}".format((await self.translate(ctx.channel,"mc","names"))[2],Item.Name) embed = self.bot.get_cog("EmbedCog").Embed(title=title, color=discord.Colour(int('16BD06',16)), url=Item.Url, time=ctx.message.created_at, desc=await self.translate(ctx.channel,'mc','contact-mail')) if Item.Image != None: embed.thumbnail(url=Item.Image) await embed.create_footer(ctx) embed.add_field(name="Nom", value=Item.Name,inline=False) l = ('\n'.join(Item.ID),Item.Stack,Item.CreativeTab,Item.Damage,Item.Strength,Item.Tool,", ".join(Item.Mobs),Item.Version) for e,v in enumerate(await self.translate(ctx.channel,"mc","item-fields")): if l[e] not in [None,'']: try: embed.add_field(name=v, value=l[e]) except: pass try: await ctx.send(embed=embed) except Exception as e: await self.bot.cogs['ErrorsCog'].on_error(e,ctx) await ctx.send(await self.translate(ctx.channel,"mc","no-entity"))
async def mc_cmd(self,ctx,*,value='help'): """Get infos about any command""" if value=='help': await ctx.send(await self.translate(ctx.channel,"mc","cmd-help")) return try: Cmd = frmc_lib.main(value,'Commande') except: await ctx.send(await self.translate(ctx.channel,"mc","no-cmd")) return title = "{} - {}".format((await self.translate(ctx.channel,"mc","names"))[3],Cmd.Name) embed = self.bot.get_cog("EmbedCog").Embed(title=title, color=discord.Colour(int('16BD06',16)), url=Cmd.Url, time=ctx.message.created_at, desc=await self.translate(ctx.channel,'mc','contact-mail')) await embed.create_footer(ctx) l = (Cmd.Name," ".join(Cmd.Syntax),Cmd.Examples,Cmd.Version) for e,v in enumerate(await self.translate(ctx.channel,"mc","cmd-fields")): if e==2: if len(l[e]) > 0: examples = ["`{}`\n*{}*".format(x[0],x[1]) for x in l[e][:5]] embed.add_field(name=v,value="\n".join(examples),inline=False) continue if l[e] not in [None,'']: try: embed.add_field(name=v, value=l[e]) except: pass try: await ctx.send(embed=embed) except Exception as e: await self.bot.cogs['ErrorsCog'].on_error(e,ctx) await ctx.send(await self.translate(ctx.channel,"mc","no-cmd"))
async def mc_entity(self,ctx,*,value='help'): """Get infos about any entity""" if value=='help': await ctx.send(await self.translate(ctx.channel,"mc","entity-help")) return try: Entity = frmc_lib.main(value,'Entité') except: await ctx.send(await self.translate(ctx.channel,"mc","no-entity")) return title = "{} - {}".format((await self.translate(ctx.channel,"mc","names"))[1],Entity.Name) embed = self.bot.get_cog("EmbedCog").Embed(title=title, color=discord.Colour(int('16BD06',16)), url=Entity.Url, time=ctx.message.created_at, desc=await self.translate(ctx.channel,'mc','contact-mail'), thumbnail=Entity.Image) await embed.create_footer(ctx) embed.add_field(name="Nom", value=Entity.Name,inline=False) l = (Entity.ID,Entity.Type,Entity.PV,Entity.PA,Entity.XP,", ".join(Entity.Biomes),Entity.Version) for e,v in enumerate(await self.translate(ctx.channel,"mc","entity-fields")): if l[e] not in [None,'']: try: embed.add_field(name=v, value=l[e]) except: pass if Entity.Dimensions != [0,0,0]: embed.add_field(name="Dimensions",value=await self.translate(ctx.channel,"mc","dimensions",la=Entity.Dimensions[0],lo=Entity.Dimensions[1],ha=Entity.Dimensions[2])) try: await ctx.send(embed=embed) except Exception as e: await self.bot.cogs['ErrorsCog'].on_error(e,ctx) await ctx.send(await self.translate(ctx.channel,"mc","no-entity"))