def rtfs(self, ctx, *, thing: str):
"""tries to show the source file of a thing
thing may be a non-builtin module, class, method, function, traceback, frame, or code object,
or if surrounded by single or double quotes,
a space separated discord.ext.commands call,
or a period deliminated file/module path as used when importing"""
msg = ctx.message
variables = {
'ctx': ctx,
'bot': self.bot,
'message': msg,
'server': msg.server,
'channel': msg.channel,
'author': msg.author
}
def call(thing, variables):
return self.repl_format_source(eval(thing, variables))
closure = _close(call, thing, variables)
await self.print_results(ctx, _call_catch_fmt(closure, 0))
评论列表
文章目录