Answer the question
In order to leave comments, you need to log in
A discord bot that replies to messages. Can you help?
Выйти должно так
<code lang="python">
import discord
import const
client = discord.Client()
@client.event
async def on_ready():
print('Загрузился {0.user}'.format(client))
@client.event
async def on_message(message):
msg = message.content.lower()
msg_list = msg.split()
find_inj = False
channel = client.get_channel(942477085727916052)
channel2 = client.get_channel(942624705779753071)
role2 = discord.utils.get(message.author.guild.roles, id=942629048578871296)
role = discord.utils.get(message.author.guild.roles, id=942629133236707358)
for item in const.inj:
if msg.find(item)>=0:
find_inj = True
if find_inj:
if channel==message.channel:
if role in message.author.roles:
return
else:
await channel.send('!Ответ Принимаю')
await message.author.add_roles(message.author.guild.get_role(898612321755230260))
await message.author.add_roles(message.author.guild.get_role(942459316059897887))
await channel2.send(f'Прочитайте закреплённое {message.author.mention}')
find_meh = False
for item in const.meh:
if msg.find(item)>=0:
find_meh = True
if find_meh:
if channel==message.channel:
if role2 in message.author.roles:
return
else:
await channel.send('!Ответ Принимаю')
await message.author.add_roles(message.author.guild.get_role(898612403284086784))
await message.author.add_roles(message.author.guild.get_role(942459495903264869))
await channel2.send(f'Прочитайте закреплённое {message.author.mention}')
client.run(const.TOKEN)
</code>
Необходимо вставить так чтобы сообщение "!Ответ Принимаю" отвечало на то, что его вызвало
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question