Added Cog Emojis
This commit is contained in:
parent
98d7d486ed
commit
3b187f8d5a
|
@ -54,3 +54,4 @@ coverage.xml
|
||||||
docs/_build/
|
docs/_build/
|
||||||
extensions/__pycache__/core.cpython-38.pyc
|
extensions/__pycache__/core.cpython-38.pyc
|
||||||
extensions/__pycache__/core.cpython-38.pyc
|
extensions/__pycache__/core.cpython-38.pyc
|
||||||
|
extensions/__pycache__/core.cpython-38.pyc
|
||||||
|
|
Binary file not shown.
|
@ -16,9 +16,11 @@ class BotList(commands.Cog, name='Bot List'):
|
||||||
"""Provides various utilities for handling BotList stuff."""
|
"""Provides various utilities for handling BotList stuff."""
|
||||||
|
|
||||||
def __init__(self, bot):
|
def __init__(self, bot):
|
||||||
|
|
||||||
# Main Stuff
|
# Main Stuff
|
||||||
self.bot = bot
|
self.bot = bot
|
||||||
self.request = bot.request
|
self.request = bot.request
|
||||||
|
self.emoji = "\U0001F5F3"
|
||||||
|
|
||||||
# List Tokens
|
# List Tokens
|
||||||
self.dbl_token = bot.config['DBL']
|
self.dbl_token = bot.config['DBL']
|
||||||
|
|
|
@ -16,20 +16,26 @@ import math
|
||||||
import psutil
|
import psutil
|
||||||
from extensions.helpcmd import TaciHelpCommand
|
from extensions.helpcmd import TaciHelpCommand
|
||||||
|
|
||||||
|
|
||||||
class Core(commands.Cog):
|
class Core(commands.Cog):
|
||||||
"""Provides all core features of a bot."""
|
"""Provides all core features of a bot."""
|
||||||
|
|
||||||
def __init__(self, bot):
|
def __init__(self, bot):
|
||||||
|
|
||||||
|
# Main Stuff
|
||||||
self.bot = bot
|
self.bot = bot
|
||||||
self.settings = {
|
self.emoji = "\U0001F4E6"
|
||||||
|
self.settings = {
|
||||||
'extensions': []
|
'extensions': []
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Help Command
|
||||||
self._original_help_command = bot.help_command
|
self._original_help_command = bot.help_command
|
||||||
if bot.config['CUSTOM_HELP']:
|
if bot.config['CUSTOM_HELP']:
|
||||||
bot.help_command = TaciHelpCommand()
|
bot.help_command = TaciHelpCommand()
|
||||||
bot.help_command.cog = self
|
bot.help_command.cog = self
|
||||||
|
|
||||||
|
# Extensions
|
||||||
self._init_extensions()
|
self._init_extensions()
|
||||||
|
|
||||||
def _init_extensions(self):
|
def _init_extensions(self):
|
||||||
|
|
|
@ -25,8 +25,13 @@ class Developer(commands.Cog):
|
||||||
"""Provides various resources for developers."""
|
"""Provides various resources for developers."""
|
||||||
|
|
||||||
def __init__(self, bot):
|
def __init__(self, bot):
|
||||||
|
|
||||||
|
# Main Stuff
|
||||||
self.bot = bot
|
self.bot = bot
|
||||||
self.request = bot.request
|
self.request = bot.request
|
||||||
|
self.emoji = "\U0001F3D7"
|
||||||
|
|
||||||
|
# Repl/Eval Stuff
|
||||||
self.repl_sessions = {}
|
self.repl_sessions = {}
|
||||||
self.repl_embeds = {}
|
self.repl_embeds = {}
|
||||||
self._eval = {}
|
self._eval = {}
|
||||||
|
|
|
@ -11,6 +11,8 @@ import itertools
|
||||||
|
|
||||||
class TaciHelpCommand(commands.MinimalHelpCommand):
|
class TaciHelpCommand(commands.MinimalHelpCommand):
|
||||||
def __init__(self, **options):
|
def __init__(self, **options):
|
||||||
|
|
||||||
|
# Main Stuff
|
||||||
super().__init__(**options)
|
super().__init__(**options)
|
||||||
self.command_attrs['help'] = "Find more assistance on this bot."
|
self.command_attrs['help'] = "Find more assistance on this bot."
|
||||||
self.subcommands_heading = "Subcommands"
|
self.subcommands_heading = "Subcommands"
|
||||||
|
@ -94,7 +96,7 @@ class TaciHelpCommand(commands.MinimalHelpCommand):
|
||||||
self.paginator.add_line(f"**{heading}**")
|
self.paginator.add_line(f"**{heading}**")
|
||||||
|
|
||||||
# TODO Make the Core Dynamic
|
# TODO Make the Core Dynamic
|
||||||
if heading == 'Core':
|
if heading == '\U0001F4E6 Core':
|
||||||
# `command1`, `command2`, `command3`
|
# `command1`, `command2`, `command3`
|
||||||
# On Same Line
|
# 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))
|
||||||
|
@ -125,7 +127,10 @@ class TaciHelpCommand(commands.MinimalHelpCommand):
|
||||||
no_category = '\u200b{0.no_category}'.format(self)
|
no_category = '\u200b{0.no_category}'.format(self)
|
||||||
def get_category(command, *, no_category=no_category):
|
def get_category(command, *, no_category=no_category):
|
||||||
cog = command.cog
|
cog = command.cog
|
||||||
return cog.qualified_name if cog is not None else no_category
|
if cog is not None:
|
||||||
|
return f"{cog.emoji} {cog.qualified_name}" if cog.emoji else cog.qualified_name
|
||||||
|
else:
|
||||||
|
return no_category
|
||||||
|
|
||||||
# Gets all commands and categories to iterate over
|
# Gets all commands and categories to iterate over
|
||||||
filtered = await self.filter_commands(bot.commands, sort=True, key=get_category)
|
filtered = await self.filter_commands(bot.commands, sort=True, key=get_category)
|
||||||
|
@ -134,13 +139,13 @@ class TaciHelpCommand(commands.MinimalHelpCommand):
|
||||||
# Splits Bot List and Core commands out of the others
|
# Splits Bot List and Core commands out of the others
|
||||||
for category, commands in to_iterate:
|
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 ['Core', 'Bot List']:
|
if category in ['\U0001F4E6 Core', '\U0001F5F3 Bot List']:
|
||||||
main_cmds.extend(commands)
|
main_cmds.extend(commands)
|
||||||
else:
|
else:
|
||||||
other_cmds[category] = commands
|
other_cmds[category] = commands
|
||||||
|
|
||||||
# Core/Bot List commands become compacted
|
# Core/Bot List commands become compacted
|
||||||
self.add_bot_commands_formatting(main_cmds, 'Core')
|
self.add_bot_commands_formatting(main_cmds, '\U0001F4E6 Core')
|
||||||
|
|
||||||
# Everything else is normal
|
# Everything else is normal
|
||||||
for category, commands in other_cmds.items():
|
for category, commands in other_cmds.items():
|
||||||
|
@ -164,7 +169,8 @@ class TaciHelpCommand(commands.MinimalHelpCommand):
|
||||||
# New Line
|
# New Line
|
||||||
|
|
||||||
# **Cog Name**
|
# **Cog Name**
|
||||||
self.paginator.add_line(f"**{cog.qualified_name}**")
|
self.paginator.add_line(
|
||||||
|
f"{cog.emoji} **{cog.qualified_name}**" if cog.emoji else f"{cog.qualified_name}")
|
||||||
|
|
||||||
# _Description if there_
|
# _Description if there_
|
||||||
if cog.description:
|
if cog.description:
|
||||||
|
|
|
@ -16,9 +16,12 @@ class Search(commands.Cog):
|
||||||
"""Searches the web for a variety of different resources."""
|
"""Searches the web for a variety of different resources."""
|
||||||
|
|
||||||
def __init__(self, bot):
|
def __init__(self, bot):
|
||||||
|
|
||||||
|
# Main Stuff
|
||||||
self.bot = bot
|
self.bot = bot
|
||||||
self.request = bot.request
|
self.request = bot.request
|
||||||
self.instances = bot.instances
|
self.instances = bot.instances
|
||||||
|
self.emoji = "\U0001F50D"
|
||||||
|
|
||||||
async def _search_logic(self, query: str, is_nsfw: bool = False, category: str = None):
|
async def _search_logic(self, query: str, is_nsfw: bool = False, category: str = None):
|
||||||
"""Provides search logic for all search commands."""
|
"""Provides search logic for all search commands."""
|
||||||
|
|
Loading…
Reference in New Issue