resuther
resuther

Reputation: 190

Error trying to send items in list Discord.py

Im trying to send each item in the list individually but if this cant be done then sending each item on a new line works just as well

Heres the code

playlists = []

@client.event
async def on_message(message):
    if message.author == client.user:
        return
    if message.author.bot: return
    if message.content == '=links':
        for x in playlists():
            await message.channel.send(x)
    if message.channel.id == 772290124117442581:
        playlists.append(message.content)
        await message.channel.send(f'Added:')
        ```await message.channel.send(f'`' + message.content + '`')

Heres the error:

TypeError: 'list' object is not callable

Upvotes: 0

Views: 172

Answers (1)

Nurqm
Nurqm

Reputation: 4743

You cannot call any parameters from a list. So basically, you can't use parentheses like playlists(). You just have to change for x in playlists(): to for x in playlists:.

Upvotes: 1

Related Questions