My discord bot has some code in it that keeps giving errors

  bots, discord, discord.py, python

So I was writing a basic Discord bot for fun. And I wanted it to count how many times "lmao was said". So I wrote this in Python:

if 'lmao' in message.content.lower():
        aantlmao=1
        await message.channel.send('aantal keer lmao gezegd:',aantlmao,'(sinds de laatste bot restart)')
        aantlmao=aantlmao+1
        print('counted a LMAO')

the message translates to: amount of times said lmao: … (since last bot restart)

but when I type lmao in discord it spits out this error:

Ignoring exception in on_message
Traceback (most recent call last):
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 343, in _run_event
await coro(*args, **kwargs)
File "main.py", line 51, in on_message
await message.channel.send(‘aantal keer lmao gezegd:’,aantlmao,'(sinds de laatste bot restart)’)
TypeError: send() takes from 1 to 2 positional arguments but 4 were given

Source: Python Questions

LEAVE A COMMENT