remove parsing from quites

This commit is contained in:
Rykov7
2024-03-16 13:48:14 +03:00
parent 0b4971b20c
commit 5563916adf
3 changed files with 9 additions and 10 deletions
+1 -1
View File
@@ -173,7 +173,7 @@ async def stan_speak(message: types.Message):
message.text, message.text,
) )
) )
await bot.send_message(message.chat.id, speak(0, message.chat.id), parse_mode='Markdown') await bot.send_message(message.chat.id, speak(0, message.chat.id), parse_mode=None)
await bot.delete_message(message.chat.id, message.id) await bot.delete_message(message.chat.id, message.id)
+1 -1
View File
@@ -57,7 +57,7 @@ def create_report_text(chat_id):
) )
top_users += f'\n{i + 1}. {html.escape(name)} [{flooder["Count"]}]' top_users += f'\n{i + 1}. {html.escape(name)} [{flooder["Count"]}]'
if len(flooders) >= 3 or s["Banned"] or s["Deleted"]: if len(flooders) >= 3 or s["Banned"]:
report = f"<b>H</b>ello, <b>W</b>orld!\n" report = f"<b>H</b>ello, <b>W</b>orld!\n"
if len(flooders) >= 3: if len(flooders) >= 3:
report += f"{top_users}\n" report += f"{top_users}\n"
+7 -8
View File
@@ -1,6 +1,5 @@
""" Stan's commands and reactions. """ """ Stan's commands and reactions. """
import asyncio import asyncio
import html
import logging import logging
import random import random
from time import time from time import time
@@ -32,7 +31,7 @@ async def send_quote(after_sec, message, quote):
await asyncio.sleep(len(message.text) * TYPING_TIMEOUT) await asyncio.sleep(len(message.text) * TYPING_TIMEOUT)
await bot.send_chat_action(message.chat.id, action="typing") await bot.send_chat_action(message.chat.id, action="typing")
await asyncio.sleep(after_sec) # Typing time await asyncio.sleep(after_sec) # Typing time
await bot.send_message(message.chat.id, html.escape(quote)) await bot.send_message(message.chat.id, quote, parse_mode=None)
async def act(message: types.Message): async def act(message: types.Message):
@@ -64,13 +63,13 @@ async def add_stan_quote(message: types.Message):
quote = message.reply_to_message.text quote = message.reply_to_message.text
if not is_quote_in_chat(quote, message.chat.id): if not is_quote_in_chat(quote, message.chat.id):
add_quote(message.chat.id, quote.replace("\n", " ")) add_quote(message.chat.id, quote.replace("\n", " "))
ok_message = await bot.send_message(message.chat.id, "⭐️ Добавил: " + quote, parse_mode='Markdown') ok_message = await bot.send_message(message.chat.id, f"⭐️ Добавил: {quote}", parse_mode=None)
await bot.delete_message(message.chat.id, message.id) await bot.delete_message(message.chat.id, message.id)
await asyncio.sleep(3) await asyncio.sleep(3)
await bot.delete_message(message.chat.id, ok_message.id) await bot.delete_message(message.chat.id, ok_message.id)
logging.info(LOG_COMM % (message.chat.title, message.from_user.id, message.from_user.full_name, f'[ADD] {message.reply_to_message.text}'))
else: else:
await bot.send_message(message.chat.id, f"⛔️ Не добавил, есть токое: {quote}", parse_mode='Markdown') await bot.send_message(message.chat.id, f"⛔️ Не добавил, есть токое: {quote}", parse_mode=None)
logging.info(LOG_COMM % (message.chat.title, message.from_user.id, message.from_user.full_name, message.text))
@bot.message_handler(func=is_white_id, commands=["remove"]) @bot.message_handler(func=is_white_id, commands=["remove"])
@@ -79,13 +78,13 @@ async def remove_stan_quote(message: types.Message):
quote = message.reply_to_message.text quote = message.reply_to_message.text
if is_quote_in_chat(quote, message.chat.id): if is_quote_in_chat(quote, message.chat.id):
delete_quote_in_chat(quote, message.chat.id) delete_quote_in_chat(quote, message.chat.id)
remove_message = await bot.send_message(message.chat.id, f"🗑 Удалил: {quote}", parse_mode='Markdown') remove_message = await bot.send_message(message.chat.id, f"🗑 Удалил: {quote}", parse_mode=None)
await bot.delete_message(message.chat.id, message.id) await bot.delete_message(message.chat.id, message.id)
await asyncio.sleep(3) await asyncio.sleep(3)
await bot.delete_message(message.chat.id, remove_message.id) await bot.delete_message(message.chat.id, remove_message.id)
logging.info(LOG_COMM % (message.chat.title, message.from_user.id, message.from_user.full_name, f'[RMV] {message.reply_to_message.text}'))
else: else:
await bot.send_message(message.chat.id, f"⛔️ Нет такого: {quote}", parse_mode='Markdown') await bot.send_message(message.chat.id, f"⛔️ Не удалил, нет такого: {quote}", parse_mode=None)
logging.info(LOG_COMM % (message.chat.title, message.from_user.id, message.from_user.full_name, message.text))
@bot.message_handler(func=is_nongrata) @bot.message_handler(func=is_nongrata)