mirror of
https://github.com/polyjitter/searchbot-discord.git
synced 2024-08-14 22:46:55 +00:00
Good citizen stuff for pylint
This commit is contained in:
parent
13e64461be
commit
1a123bc25d
6 changed files with 23 additions and 19 deletions
|
@ -36,7 +36,7 @@ class BotList(commands.Cog, name='Bot List'):
|
|||
self.bot, self.dbl_token)
|
||||
|
||||
# Start update loop
|
||||
self.update_stats.start()
|
||||
self.update_stats.start() # pylint: disable=no-member
|
||||
|
||||
async def _update_logic(self):
|
||||
"""Handles all statistic updating for various different bot lists."""
|
||||
|
@ -168,7 +168,7 @@ class BotList(commands.Cog, name='Bot List'):
|
|||
await self._update_logic()
|
||||
|
||||
def cog_unload(self):
|
||||
self.update_stats.cancel()
|
||||
self.update_stats.cancel() # pylint: disable=no-member
|
||||
|
||||
|
||||
def setup(bot):
|
||||
|
|
|
@ -343,7 +343,7 @@ Guild count: {len(self.bot.guilds)}
|
|||
"You wish to use me in!_"
|
||||
)
|
||||
|
||||
await guild.owner.send(guild_msg)
|
||||
await owner.send(guild_msg)
|
||||
return # Ends here if there are no good channels to send to
|
||||
|
||||
# Owner Disclosure
|
||||
|
@ -362,7 +362,7 @@ Guild count: {len(self.bot.guilds)}
|
|||
)
|
||||
|
||||
# Send owner disclosure
|
||||
await guild.owner.send(owner_msg)
|
||||
await owner.send(owner_msg)
|
||||
|
||||
|
||||
def setup(bot):
|
||||
|
|
|
@ -5,9 +5,11 @@
|
|||
|
||||
'''HelpCmd File'''
|
||||
|
||||
import itertools
|
||||
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
import itertools
|
||||
|
||||
|
||||
class TaciHelpCommand(commands.MinimalHelpCommand):
|
||||
def __init__(self, **options):
|
||||
|
@ -105,13 +107,14 @@ class TaciHelpCommand(commands.MinimalHelpCommand):
|
|||
if heading == '\U0001F4E6 Core':
|
||||
# `command1`, `command2`, `command3`
|
||||
# On Same Line
|
||||
self.paginator.add_line(", ".join(f"`{c.name}`" for c in commands))
|
||||
self.paginator.add_line(
|
||||
", ".join(f"`{c.name}`" for c in commands))
|
||||
else:
|
||||
# `command` - description
|
||||
# On new lines
|
||||
for c in commands:
|
||||
self.paginator.add_line(f"`{c.name}` - {c.short_doc}")
|
||||
|
||||
|
||||
# New Line
|
||||
self.paginator.add_line()
|
||||
|
||||
|
@ -130,8 +133,8 @@ class TaciHelpCommand(commands.MinimalHelpCommand):
|
|||
self.paginator.add_line(note, empty=True)
|
||||
|
||||
# Gets the category for each command in the bot
|
||||
no_category = f"\u200b{self.no_category}"
|
||||
def get_category(command, *, no_category=no_category):
|
||||
def get_category(command, *,
|
||||
no_category = f"\u200b{self.no_category}"):
|
||||
cog = command.cog
|
||||
if cog is not None:
|
||||
return f"{cog.emoji} {cog.qualified_name}" if cog.emoji else cog.qualified_name
|
||||
|
@ -144,12 +147,13 @@ class TaciHelpCommand(commands.MinimalHelpCommand):
|
|||
|
||||
# Splits Bot List and Core commands out of the others
|
||||
for category, commands in to_iterate:
|
||||
commands = sorted(commands, key=lambda c: c.name) if self.sort_commands else list(commands)
|
||||
commands = sorted(
|
||||
commands, key=lambda c: c.name) if self.sort_commands else list(commands)
|
||||
if category in ['\U0001F4E6 Core', '\U0001F5F3 Bot List']:
|
||||
main_cmds.extend(commands)
|
||||
main_cmds.extend(commands)
|
||||
else:
|
||||
other_cmds[category] = commands
|
||||
|
||||
|
||||
# Core/Bot List commands become compacted
|
||||
self.add_bot_commands_formatting(main_cmds, '\U0001F4E6 Core')
|
||||
|
||||
|
@ -197,7 +201,7 @@ class TaciHelpCommand(commands.MinimalHelpCommand):
|
|||
# Sends the completed help output
|
||||
await self.send_pages()
|
||||
|
||||
async def send_group_help(self, group):
|
||||
async def send_group_help(self, group):
|
||||
"""Sends the help for a command group."""
|
||||
|
||||
# Adds the header if there
|
||||
|
@ -206,7 +210,7 @@ class TaciHelpCommand(commands.MinimalHelpCommand):
|
|||
self.paginator.add_line(note, empty=True)
|
||||
# New Line
|
||||
|
||||
# Adds the formatting for the main group command
|
||||
# Adds the formatting for the main group command
|
||||
self.add_command_formatting(group)
|
||||
|
||||
# Adds any subcommands
|
||||
|
@ -218,7 +222,7 @@ class TaciHelpCommand(commands.MinimalHelpCommand):
|
|||
for command in filtered:
|
||||
self.add_subcommand_formatting(command)
|
||||
|
||||
# Adds the footer if there
|
||||
# Adds the footer if there
|
||||
note = self.get_ending_note()
|
||||
if note:
|
||||
self.paginator.add_line() # New Line
|
||||
|
@ -248,6 +252,7 @@ class TaciHelpCommand(commands.MinimalHelpCommand):
|
|||
self.paginator.close_page() # TODO What does this do?
|
||||
await self.send_pages()
|
||||
|
||||
|
||||
def setup(bot):
|
||||
"""Lets helpcmd be added and reloaded as an extension."""
|
||||
pass
|
||||
pass
|
||||
|
|
|
@ -135,8 +135,7 @@ class SpecialtySearch(commands.Cog, name="Specialty"):
|
|||
|
||||
await ctx.send(f"**{title}** - <{url}>", embed=embed)
|
||||
|
||||
except Exception as e:
|
||||
|
||||
except:
|
||||
aired = f"{anime['attributes']['startDate']}{thing}"
|
||||
template = f"""
|
||||
url: {url}
|
||||
|
|
|
@ -5,10 +5,10 @@
|
|||
|
||||
'''Online File'''
|
||||
|
||||
import asyncio
|
||||
import traceback
|
||||
from typing import Optional
|
||||
|
||||
import asyncio
|
||||
import discord
|
||||
from discord.ext.commands import Context
|
||||
|
||||
|
|
Loading…
Reference in a new issue