Python
2
Вклад в тег
@bot.event
async def on_message(message):
if message.author == bot.user: return # если сообщение от бота - игнорируем
banwords = ["всякие", "нехорошие", "и", "матные", "слова"]
for word in banwords:
if word in message.content.lower():
try:
await message.delete()
except:
pass
await message.channel.send(f'{message.author.mention}, не лучшее место для мата')
break
import json
banwords = ["очень", "плохие", "и", "оскорбительные", "слова"] # здесь создаём список со словами
with open("banwords.json") as f: # считываем json код
banwords = json.load(f)
# with open("banwords .json", "w") as f: Если надо сохранить файл, то убираем # здесь и ниже
# json.dump(banwords , f)
newBackground = pygame.transform.scale(background, (WIDTH, HEIGHT))