1
0
Fork 0
mirror of https://github.com/uhIgnacio/EmoteManager.git synced 2024-08-15 02:23:13 +00:00

add raw form to list cmd

This commit is contained in:
bmintz 2018-07-31 05:13:54 -05:00
parent c5c6e7ef24
commit cfb51bf8b4

View file

@ -9,14 +9,6 @@ import weakref
import traceback
import contextlib
logger = logging.getLogger(__name__)
try:
from wand.image import Image
except ImportError:
logger.warn('failed to import wand.image. Image manipulation functions will be unavailable.')
Image = None
import aiohttp
import discord
from discord.ext import commands
@ -26,6 +18,8 @@ import utils.image
from utils import errors
from utils.paginator import ListPaginator
logger = logging.getLogger(__name__)
class Emotes:
def __init__(self, bot):
self.bot = bot
@ -212,14 +206,18 @@ class Emotes:
@commands.command()
async def list(self, context):
"""A list of all emotes on this server."""
"""A list of all emotes on this server.
The list shows each emote and its raw form.
"""
emotes = sorted(
filter(lambda e: e.require_colons, context.guild.emojis),
key=lambda e: e.name.lower())
processed = []
for emote in emotes:
processed.append(f'{emote} (\:{emote.name}:)')
raw = str(emote).replace(':', '\:')
processed.append(f'{emote} {raw}')
paginator = ListPaginator(context, processed)
self.paginators.add(paginator)