add google it!
This commit is contained in:
+1
-1
@@ -14,4 +14,4 @@ TEST_CHAT = -1001622893830
|
|||||||
|
|
||||||
URL_RX = re.compile(r'\w+\.\w+/\w+')
|
URL_RX = re.compile(r'\w+\.\w+/\w+')
|
||||||
ALLOWED_WORDS = ['pastebin', 'github', 'google', 'nometa', 'python',
|
ALLOWED_WORDS = ['pastebin', 'github', 'google', 'nometa', 'python',
|
||||||
'stackoverflow', 'habr', 'medium']
|
'stackoverflow', 'habr', 'medium', 'youtube']
|
||||||
|
|||||||
+10
-1
@@ -1,6 +1,6 @@
|
|||||||
from .config import bot
|
from .config import bot
|
||||||
from telebot import types
|
from telebot import types
|
||||||
|
from urllib import parse
|
||||||
|
|
||||||
@bot.message_handler(commands=['tsya'])
|
@bot.message_handler(commands=['tsya'])
|
||||||
def send_tsya_link(message: types.Message):
|
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.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:
|
def check_unwanted_list(type_message: types.Message) -> bool:
|
||||||
""" Check for bloggers. """
|
""" Check for bloggers. """
|
||||||
unwanted_phrases = ['дудар', 'хауди', 'dudar']
|
unwanted_phrases = ['дудар', 'хауди', 'dudar']
|
||||||
|
|||||||
Reference in New Issue
Block a user