add google it!

This commit is contained in:
Rykov7
2022-11-19 02:54:53 +03:00
parent 20b8ff3b8e
commit ad440371d3
2 changed files with 11 additions and 2 deletions
+1 -1
View File
@@ -14,4 +14,4 @@ TEST_CHAT = -1001622893830
URL_RX = re.compile(r'\w+\.\w+/\w+')
ALLOWED_WORDS = ['pastebin', 'github', 'google', 'nometa', 'python',
'stackoverflow', 'habr', 'medium']
'stackoverflow', 'habr', 'medium', 'youtube']
+10 -1
View File
@@ -1,6 +1,6 @@
from .config import bot
from telebot import types
from urllib import parse
@bot.message_handler(commands=['tsya'])
def send_tsya_link(message: types.Message):
@@ -12,6 +12,15 @@ def send_tsya_link(message: types.Message):
bot.send_message(message.chat.id, link, parse_mode='HTML', disable_web_page_preview=True)
@bot.message_handler(commands=['g'])
def google_it(message: types.Message):
""" Google it! """
if message.reply_to_message.text:
search = parse.quote_plus(message.reply_to_message.text)
bot.reply_to(message.reply_to_message, f"https://www.google.ru/search?q={search}", parse_mode='HTML',
disable_web_page_preview=True)
def check_unwanted_list(type_message: types.Message) -> bool:
""" Check for bloggers. """
unwanted_phrases = ['дудар', 'хауди', 'dudar']