Answer the question
In order to leave comments, you need to log in
Writes two messages instead of one. What to do?
What to do bot sends two or three identical messages instead of one. What to do?
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
Answer the question
In order to leave comments, you need to log in
A record of the form:
indicates a complete ignorance of the Python language. Accordingly, without knowing the language, nothing good can be written. Great happiness that this code at least does not control nuclear warheads. You have to start with the basics.
if xxx == ('a' or 'b' or 'c'):
message_content in ("first_string", "second_string")
Thanks for answers.
Those. if I have a file called A Postscript File with the name name.ai, is there already a ready-made map?
Embed it in html with <img>
?
Can be done on D3 . There is also a jQuery library for drawing maps - jQuery Mapael
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question