Skip to content

Error in emoji list command #34

@gamingboots

Description

@gamingboots

I was trying to make the emoji list command by looking at your code but i keep getting an error

code:

@slash_command(guild_ids=[883180896038027336,903168731885240350])
async def emoji_list(self,ctx, image_type='all'):
    emotes = sorted(
        filter(image_type, ctx.guild.emojis),
        key=lambda e: e.name.lower())
    processed=[]
    for emote in emotes:
        raw=str(emote).replace(':',r'\:')
        processed.append(f'{emote} {raw}')
    paginator=ListPaginator(ctx,processed)
    self.paginator.add(paginator)
    await paginator.begin()

error:
`
Ignoring exception in command emoji_list:
Traceback (most recent call last):
File "C:\Users\Baban\AppData\Roaming\Python\Python39\site-packages\discord\commands\core.py", line 110, in wrapped
ret = await coro(arg)
File "C:\Users\Baban\AppData\Roaming\Python\Python39\site-packages\discord\commands\core.py", line 770, in _invoke
await self.callback(self.cog, ctx, **kwargs)
File "c:\Users\Baban\OneDrive\Desktop\python\Ceres discord\cogs\utility.py", line 314, in emoji_list
emotes = sorted(
TypeError: 'str' object is not callable

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "C:\Users\Baban\AppData\Roaming\Python\Python39\site-packages\discord\bot.py", line 768, in process_application_commands
await ctx.command.invoke(ctx)
File "C:\Users\Baban\AppData\Roaming\Python\Python39\site-packages\discord\commands\core.py", line 306, in invoke
await injected(ctx)
File "C:\Users\Baban\AppData\Roaming\Python\Python39\site-packages\discord\commands\core.py", line 116, in wrapped
raise ApplicationCommandInvokeError(exc) from exc
discord.commands.errors.ApplicationCommandInvokeError: Application Command raised an exception: TypeError: 'str' object is not callable`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions