forked from blizzthewolf/SeaCogs
fix(updatechecker): more pylint fixes
This commit is contained in:
parent
bc57fb8eca
commit
45fcc00cdb
1 changed files with 162 additions and 169 deletions
|
@ -75,12 +75,10 @@ class UpdateChecker(commands.Cog):
|
|||
|
||||
@tasks.loop(minutes=1)
|
||||
async def bg_task(self):
|
||||
while True:
|
||||
cog = self.bot.get_cog("Downloader")
|
||||
if cog is not None:
|
||||
data = await self.conf.all()
|
||||
repos = data["repos"]
|
||||
auto = data["auto"]
|
||||
channel = data["gochannel"]
|
||||
use_embed = data["embed"]
|
||||
whitelist = data["whitelist"]
|
||||
|
@ -315,9 +313,8 @@ class UpdateChecker(commands.Cog):
|
|||
if channel == 0:
|
||||
channel = "Direct Messages"
|
||||
else:
|
||||
try:
|
||||
channel = self.bot.get_channel(channel).name
|
||||
except:
|
||||
if channel is None:
|
||||
channel = "Unknown"
|
||||
e.add_field(name="Update Channel", value=channel)
|
||||
await ctx.send(embed=e)
|
||||
|
@ -325,9 +322,8 @@ class UpdateChecker(commands.Cog):
|
|||
if channel == 0:
|
||||
channel = "Direct Messages"
|
||||
else:
|
||||
try:
|
||||
channel = self.bot.get_channel(channel).name
|
||||
except:
|
||||
if channel is None:
|
||||
channel = "Unknown"
|
||||
message = (
|
||||
"```css\n"
|
||||
|
@ -363,7 +359,6 @@ class UpdateChecker(commands.Cog):
|
|||
@whiteblacklist.group()
|
||||
async def whitelist(self, ctx):
|
||||
"""Whitelist certain repos from which to receive updates."""
|
||||
pass
|
||||
|
||||
@whitelist.command(name="add")
|
||||
async def whitelistadd(self, ctx, *repos: Repo):
|
||||
|
@ -396,7 +391,6 @@ class UpdateChecker(commands.Cog):
|
|||
@whiteblacklist.group()
|
||||
async def blacklist(self, ctx):
|
||||
"""Blacklist certain repos from which to receive updates."""
|
||||
pass
|
||||
|
||||
@blacklist.command(name="add")
|
||||
async def blacklistadd(self, ctx, *repos: Repo):
|
||||
|
@ -430,7 +424,6 @@ class UpdateChecker(commands.Cog):
|
|||
@update.group(name="task")
|
||||
async def _group_update_task(self, ctx):
|
||||
"""View the status of the task (the one checking for updates)."""
|
||||
pass
|
||||
|
||||
@_group_update_task.command()
|
||||
async def status(self, ctx):
|
||||
|
@ -462,5 +455,5 @@ class UpdateChecker(commands.Cog):
|
|||
message = "No error has been encountered."
|
||||
else:
|
||||
ex = traceback.format_exception(type(e), e, e.__traceback__)
|
||||
message = "An error has been encountered: ```py\n" + "".join(ex) + "```"
|
||||
message = "An error has been encountered:" + box("".join(ex), "py")
|
||||
await ctx.send(message)
|
||||
|
|
Loading…
Reference in a new issue