def help(self, ctx, *, architecture: str = None):
"""
Prints help
"""
me = ctx.guild.me
if architecture is None:
embed = self._embed(ctx, "Assembler help", "To invoke Assembler, call {} assemble `<architecture>` `<assembly code block>`. For help, call {} help or {} help `[architecture]` to show how"
" to assemble for given architecture. Source code of the bot is available [on Emzi's GitHub](https://github.com/Emzi0767/Discord-ASM-Bot). To"
" invite the bot to your server, Follow [this invite link]"
"(https://discordapp.com/oauth2/authorize?client_id=283200903937261569&scope=bot&permissions=0). For more help or support, join [Emzi's server]"
"(https://discord.gg/rGKrJDR).".format(me.mention, me.mention, me.mention), "info")
embed.add_field(name="Example", value=me.mention + " assemble x86 ```x86asm\nmov eax, sp\n```", inline=False)
archstr = "• " + "\n• ".join(x.display_name for x in self._archmap)
embed.add_field(name="Available architectures", value=archstr, inline=False)
else:
arch = None
for xarch in self._archmap:
if xarch.display_name == architecture:
arch = xarch
if arch is None:
raise Exception("Unknown architecture specified")
embed = self._embed(ctx, "Architecture help", "Architecture name: {}\nArchitecture full name: `{}`".format(arch.display_name, arch.clang_name))
archstr = ", ".join("`{}`".format(x) for x in arch.names)
embed.add_field(name="Architecture aliases", value=archstr, inline=False)
await ctx.channel.send(embed=embed)
评论列表
文章目录