Compare commits
2 commits
ea5f51892a
...
59d33ea87d
Author | SHA1 | Date | |
---|---|---|---|
59d33ea87d | |||
65cfafc7b3 |
2 changed files with 5 additions and 5 deletions
|
@ -39,7 +39,7 @@ class PartialEmoji(discord.PartialEmoji):
|
||||||
The group name of the emoji if it is a native emoji.
|
The group name of the emoji if it is a native emoji.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, *, name: str, animated: bool = False, id: int | None = None, group: str | None = None, aliases: list | None = None) -> None: # pylint: disable=redefined-builtin
|
def __init__(self, *, name: str, animated: bool = False, id: int | None = None, group: str | None = None, aliases: list | None = None) -> None: # pylint: disable=redefined-builtin # noqa: A002
|
||||||
super().__init__(name=name, animated=animated, id=id)
|
super().__init__(name=name, animated=animated, id=id)
|
||||||
self.group = group
|
self.group = group
|
||||||
self.aliases = aliases
|
self.aliases = aliases
|
||||||
|
@ -72,9 +72,9 @@ class PartialEmoji(discord.PartialEmoji):
|
||||||
match = cls._CUSTOM_EMOJI_RE.match(value)
|
match = cls._CUSTOM_EMOJI_RE.match(value)
|
||||||
if match is not None:
|
if match is not None:
|
||||||
groups = match.groupdict()
|
groups = match.groupdict()
|
||||||
animated = bool(groups['animated'])
|
animated = bool(groups["animated"])
|
||||||
emoji_id = int(groups['id'])
|
emoji_id = int(groups["id"])
|
||||||
name = groups['name']
|
name = groups["name"]
|
||||||
return cls(name=name, animated=animated, id=emoji_id)
|
return cls(name=name, animated=animated, id=emoji_id)
|
||||||
|
|
||||||
path: data_manager.Path = data_manager.bundled_data_path(coginstance) / "emojis.json"
|
path: data_manager.Path = data_manager.bundled_data_path(coginstance) / "emojis.json"
|
||||||
|
|
|
@ -76,7 +76,7 @@ class SeaUtils(commands.Cog):
|
||||||
|
|
||||||
@commands.command(aliases=["source", "src", "code", "showsource"])
|
@commands.command(aliases=["source", "src", "code", "showsource"])
|
||||||
@commands.is_owner()
|
@commands.is_owner()
|
||||||
async def showcode(self, ctx: commands.Context, *, object: str) -> None: # pylint: disable=redefined-builtin
|
async def showcode(self, ctx: commands.Context, *, object: str) -> None: # pylint: disable=redefined-builtin # noqa: A002
|
||||||
"""Show the code for a particular object."""
|
"""Show the code for a particular object."""
|
||||||
try:
|
try:
|
||||||
if object.startswith("/") and (obj := ctx.bot.tree.get_command(object[1:])):
|
if object.startswith("/") and (obj := ctx.bot.tree.get_command(object[1:])):
|
||||||
|
|
Loading…
Add table
Reference in a new issue