Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in emoji list command #34

Open
gamingboots opened this issue Mar 15, 2022 · 0 comments
Open

Error in emoji list command #34

gamingboots opened this issue Mar 15, 2022 · 0 comments

Comments

@gamingboots
Copy link

gamingboots commented Mar 15, 2022

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`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant