Что делать бот отправляет два или три одинаковых сообщения вместо одного. Что делать?
import discord
client = discord.Client()
@client.event
async def on_ready():
print('We have logged in as {0.user}'.format(client))
@client.event
async def on_message(message):
message.content = message.content.lower()
if message.author == client.user:
return
if message.content == ('ghbdtn' or 'ghbdtn!' or 'ghbdtn)'):
await message.channel.send(f'>>> **_{message.author}_ хотел сказать:** Привет!')
await message.delete()
if message.content == ('gjrf' or 'gjrf!' or 'gjrf)'):
await message.channel.send(f'>>> **_{message.author}_ хотел сказать:** Пока!')
await message.delete()
if message.content == ('cgc' or 'cgc!' or 'cgc)' or 'cgfcb,j' or 'cgfcb,j!' or 'cgfcb,j)'):
await message.channel.send(f'>>> **_{message.author}_ хотел сказать:** Спасибо!')
await message.delete()
if message.content == ('rfr ltkf' or 'rfr ltkf?' or 'rfr ltkf)' or 'rfr ltkf,' or 'rfr ltkbirb'):
await message.channel.send(f'>>> **_{message.author}_ хотел сказать:** Как дела?')
await message.delete()
client.run('token')
И вылезает такая ошибка.
Ignoring exception in on_message
Traceback (most recent call last):
File "D:\Play\Project\discord-bot\venv\lib\site-packages\discord\client.py", line 343, in _run_event
await coro(*args, **kwargs)
File "D:\Play\Project\discord-bot\main.py", line 21, in on_message
await message.delete()
File "D:\Play\Project\discord-bot\venv\lib\site-packages\discord\message.py", line 1023, in delete
await self._state.http.delete_message(self.channel.id, self.id)
File "D:\Play\Project\discord-bot\venv\lib\site-packages\discord\http.py", line 250, in request
raise NotFound(r, data)
discord.errors.NotFound: 404 Not Found (error code: 10008): Unknown Message