mirror of
https://github.com/uhIgnacio/EmoteManager.git
synced 2024-08-15 02:23:13 +00:00
make the export command public
This commit is contained in:
parent
a1ce0b8281
commit
aeed3b6a56
1 changed files with 11 additions and 2 deletions
|
@ -93,11 +93,18 @@ class Emotes(commands.Cog):
|
||||||
|
|
||||||
self.bot.loop.create_task(close())
|
self.bot.loop.create_task(close())
|
||||||
|
|
||||||
|
public_commands = set()
|
||||||
|
def public(command, public_commands=public_commands): # resolve some kinda scope issue that i don't understand
|
||||||
|
public_commands.add(command.qualified_name)
|
||||||
|
return command
|
||||||
|
|
||||||
async def cog_check(self, context):
|
async def cog_check(self, context):
|
||||||
if not context.guild or not isinstance(context.author, discord.Member):
|
if not context.guild or not isinstance(context.author, discord.Member):
|
||||||
raise commands.NoPrivateMessage
|
raise commands.NoPrivateMessage
|
||||||
|
|
||||||
if context.command is self.list or context.command is self.stats:
|
# we can't just do `context.command.qualified_name in self.public_commands` here
|
||||||
|
# because apparently Command.__eq__ is not defined
|
||||||
|
if context.command.qualified_name in self.public_commands:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
if (
|
if (
|
||||||
|
@ -233,6 +240,7 @@ class Emotes(commands.Cog):
|
||||||
|
|
||||||
await context.send(message)
|
await context.send(message)
|
||||||
|
|
||||||
|
@public
|
||||||
@emote_type_filter_default
|
@emote_type_filter_default
|
||||||
@commands.command()
|
@commands.command()
|
||||||
@commands.bot_has_permissions(attach_files=True)
|
@commands.bot_has_permissions(attach_files=True)
|
||||||
|
@ -475,6 +483,7 @@ class Emotes(commands.Cog):
|
||||||
|
|
||||||
await context.send(fr'Emote successfully renamed to \:{new_name}:')
|
await context.send(fr'Emote successfully renamed to \:{new_name}:')
|
||||||
|
|
||||||
|
@public
|
||||||
@emote_type_filter_default
|
@emote_type_filter_default
|
||||||
@commands.command(aliases=('ls', 'dir'))
|
@commands.command(aliases=('ls', 'dir'))
|
||||||
async def list(self, context, image_type='all'):
|
async def list(self, context, image_type='all'):
|
||||||
|
@ -499,6 +508,7 @@ class Emotes(commands.Cog):
|
||||||
self.paginators.add(paginator)
|
self.paginators.add(paginator)
|
||||||
await paginator.begin()
|
await paginator.begin()
|
||||||
|
|
||||||
|
@public
|
||||||
@commands.command(aliases=['status'])
|
@commands.command(aliases=['status'])
|
||||||
async def stats(self, context):
|
async def stats(self, context):
|
||||||
"""The current number of animated and static emotes relative to the limits."""
|
"""The current number of animated and static emotes relative to the limits."""
|
||||||
|
@ -564,6 +574,5 @@ class Emotes(commands.Cog):
|
||||||
|
|
||||||
return candidates[int(message.content)-1]
|
return candidates[int(message.content)-1]
|
||||||
|
|
||||||
|
|
||||||
def setup(bot):
|
def setup(bot):
|
||||||
bot.add_cog(Emotes(bot))
|
bot.add_cog(Emotes(bot))
|
||||||
|
|
Loading…
Reference in a new issue