fix(seautils): pylint fixes
This commit is contained in:
parent
d95c9b3255
commit
7ed836a1cd
1 changed files with 5 additions and 5 deletions
|
@ -38,7 +38,7 @@ class SeaUtils(commands.Cog):
|
|||
]
|
||||
return "\n".join(text)
|
||||
|
||||
def format_src(self, ctx: commands.Context, obj: Any) -> str:
|
||||
def format_src(self, obj: Any) -> str:
|
||||
"""A large portion of this code is repurposed from Zephyrkul's RTFS cog.
|
||||
https://github.com/Zephyrkul/FluffyCogs/blob/master/rtfs/rtfs.py"""
|
||||
obj = inspect.unwrap(obj)
|
||||
|
@ -55,15 +55,15 @@ class SeaUtils(commands.Cog):
|
|||
|
||||
@commands.command(aliases=["source", "src", "code", "showsource"])
|
||||
@commands.is_owner()
|
||||
async def showcode(self, ctx: commands.Context, *, object: str):
|
||||
async def showcode(self, ctx: commands.Context, *, object: str): # pylint: disable=redefined-builtin
|
||||
"""Show the code for a particular object."""
|
||||
try:
|
||||
if object.startswith("/") and (obj := ctx.bot.tree.get_command(object[1:])):
|
||||
text = self.format_src(ctx, obj)
|
||||
text = self.format_src(obj)
|
||||
elif obj := ctx.bot.get_cog(object):
|
||||
text = self.format_src(ctx, type(obj))
|
||||
text = self.format_src(type(obj))
|
||||
elif obj := ctx.bot.get_command(object):
|
||||
text = self.format_src(ctx, obj)
|
||||
text = self.format_src(obj)
|
||||
temp_content = cf.pagify(
|
||||
text=cleanup_code(text),
|
||||
escape_mass_mentions=True,
|
||||
|
|
Loading…
Reference in a new issue