upd start
This commit is contained in:
+10
-17
@@ -18,16 +18,20 @@ from .config import *
|
||||
app = Flask(__name__)
|
||||
|
||||
|
||||
@bot.message_handler(commands=['start'])
|
||||
@bot.message_handler(commands=['start', 'links'])
|
||||
def start(message: types.Message):
|
||||
""" Just write log. Nothing happen. """
|
||||
""" What to begin with. """
|
||||
log_msg = f'[START] {message.from_user.id} {message.from_user.first_name}'
|
||||
if message.from_user.last_name:
|
||||
log_msg += f' {message.from_user.last_name}'
|
||||
bot.send_message(message.chat.id,
|
||||
f'Привет, {message.from_user.first_name}\nЗдесь можно опробовать команды из меню.')
|
||||
logging.warning(log_msg)
|
||||
|
||||
markup = types.InlineKeyboardMarkup()
|
||||
markup.add(RULES, FAQ, LIB, row_width=1)
|
||||
answer = "Начни с прочтения"
|
||||
if message.reply_to_message:
|
||||
bot.reply_to(message.reply_to_message, answer, reply_maarkup=markup)
|
||||
else:
|
||||
bot.send_message(message.chat.id, answer, reply_markup=markup)
|
||||
|
||||
|
||||
"""
|
||||
[ ANTISPAM FILTERS ]
|
||||
@@ -69,17 +73,6 @@ def delete_message(message: types.Message):
|
||||
"""
|
||||
|
||||
|
||||
@bot.message_handler(commands=['links'])
|
||||
def send_links(message):
|
||||
markup = types.InlineKeyboardMarkup()
|
||||
markup.add(RULES, FAQ, LIB, row_width=1)
|
||||
answer = "Почитай на досуге"
|
||||
if message.reply_to_message:
|
||||
bot.reply_to(message.reply_to_message, answer, reply_maarkup=markup)
|
||||
else:
|
||||
bot.send_message(message.chat.id, answer, reply_markup=markup)
|
||||
|
||||
|
||||
@bot.message_handler(commands=['rules', 'rule', 'r'])
|
||||
def send_rules(message):
|
||||
markup = types.InlineKeyboardMarkup()
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ ENG_RUS_TABLE = str.maketrans(ENG, RUS)
|
||||
|
||||
RULES = types.InlineKeyboardButton('🟡 Правила чата', url='https://telegra.ph/pythonchatru-07-07')
|
||||
FAQ = types.InlineKeyboardButton('🔵 Частые вопросы', url='https://telegra.ph/faq-10-07-4')
|
||||
LIB = types.InlineKeyboardButton('📚 Библиотека', url='https://telegra.ph/what-to-read-10-06')
|
||||
LIB = types.InlineKeyboardButton('📚 Книги', url='https://telegra.ph/what-to-read-10-06')
|
||||
|
||||
SPAM = ['me.sv/', 'tg.sv/', 'goo.by/', 'go.sv/', 'intim.video/', 'uclck.ru/']
|
||||
NON_GRATA = ['дудар', 'хауди', 'dudar']
|
||||
|
||||
@@ -10,7 +10,3 @@ def get_rule(li):
|
||||
return html.find_all('li')[li - 1].text
|
||||
except IndexError:
|
||||
return 'Нет такого правила.'
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
print(get_rule(1))
|
||||
|
||||
Reference in New Issue
Block a user