Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import config
- import telebot
- from telebot import types
- bot = telebot.TeleBot(config.token)
- print('Bot has been started')
- markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
- markup.row('📦 Скачать Termux', '📚 Установка софта', '📱 Кастомизация')
- markup.row('🌐 Telegram чат Termux', 'ℹ️ Помощь', '💬 Оставить отзыв')
- remove_markup = types.ReplyKeyboardRemove()
- @bot.message_handler(commands=['start'])
- def handle_start(message):
- print(message.from_user.username + ' зашел')
- bot.send_message(message.chat.id, 'Добрый день', reply_markup=remove_markup)
- bot.send_message(message.chat.id, "Выбери рубрику: ", reply_markup=markup)
- #Вот на этом моменте, после вызова этой фйнкции 2 раз, бот крашится
- @bot.message_handler(commands=['comment'])
- def comment(message):
- msg = bot.send_message(message.chat.id, 'Введите отзыв:')
- bot.register_next_step_handler(msg, rewiew)
- def rewiew(message):
- print(message.from_user.username + ' оставил отзыв: ' + message.text)
- file = open('review.txt', 'a')
- file.write(message.from_user.username + ' говорит: ' + message.text + '\n')
- @bot.message_handler(content_types=['text'])
- def choose_handle(message):
- if message.text == '📦 Скачать Termux':
- keyboard = types.InlineKeyboardMarkup()
- keyboard.add(types.InlineKeyboardButton(text="Скачать Termux(4PDA)", url="https://4pda.ru/forum/lofiversion/index.php?t741456.html"))
- keyboard.add(types.InlineKeyboardButton(text="Скачать Termux(Google Play)", url="https://play.google.com/store/apps/details?id=com.termux&hl=ru"))
- keyboard.add(types.InlineKeyboardButton(text="Скачать Add-ons для Termux(4PDA)", url="https://4pda.ru/forum/index.php?showtopic=741456&st=340#entry67974935"))
- bot.send_message(message.chat.id, "Нажми на кнопку и скачай нужную программу.", reply_markup=keyboard)
- if message.text == '📚 Установка софта':
- keyboard = types.InlineKeyboardMarkup()
- keyboard.add(types.InlineKeyboardButton(text="Что нужно сделать сразу после установки Termux", url="https://telegra.ph/CHto-nuzhno-sdelat-srazu-posle-ustanovki-Termux-12-07"))
- keyboard.add(types.InlineKeyboardButton(text="Установка nethunter в termux", url="https://telegra.ph/Ustanovka-nethunter-v-termux-12-07"))
- keyboard.add(types.InlineKeyboardButton(text="Установка DarkFly в termux (tools 500+)", url="https://telegra.ph/Ustanovka-DarkFly-v-termux-tools-500-12-07"))
- keyboard.add(types.InlineKeyboardButton(text="Установка instainsane в termux/nethunter (Брут Instagram)", url="https://telegra.ph/Ustanovka-instainsane-v-termuxnethunter-brut-Instagram-12-07"))
- keyboard.add(types.InlineKeyboardButton(text="Установка metasploit в termux", url="https://telegra.ph/Ustanovka-metasploit-v-termux-12-07"))
- keyboard.add(types.InlineKeyboardButton(text="Установка Tmux-Bunch в termux (аналог apktool)", url="https://telegra.ph/Ustanovka-Tmux-Bunch-v-termux-analog-apktool-12-07"))
- keyboard.add(types.InlineKeyboardButton(text="Установка Tmux(менеджер терминалов,работа в нескольких окнах одновременно)", url="https://telegra.ph/Ustanovka-Tmuxmenedzher-terminalovrabota-v-neskolkih-oknah-odnovremenno-12-07"))
- keyboard.add(types.InlineKeyboardButton(text="Полный фарш на termux для Python", url="https://telegra.ph/Polnyj-farsh-na-termux-dlya-Python-12-07"))
- keyboard.add(types.InlineKeyboardButton(text="Установка и использование Apache2 в Termux", url="https://telegra.ph/Ustanovka-i-ispolzovanie-Apache2-v-Termux-12-08"))
- bot.send_message(message.chat.id, "Нажми на кнопку и откроется статья.", reply_markup=keyboard)
- if message.text == '📱 Кастомизация':
- keyboard = types.InlineKeyboardMarkup()
- keyboard.add(types.InlineKeyboardButton(text="Кастомизация Termux", url="https://telegra.ph/Kastomizaciya-Termux-12-07"))
- bot.send_message(message.chat.id, "Нажми на кнопку и откроется статья.", reply_markup=keyboard)
- if message.text == '🌐 Telegram чат Termux':
- keyboard = types.InlineKeyboardMarkup()
- keyboard.add(types.InlineKeyboardButton(text="Termux | 4PDA | RU", url="tg://join?invite=HYcitEbYSwDAXIchuhpAZw"))
- bot.send_message(message.chat.id, "Ссылка на чат", reply_markup=keyboard)
- if message.text == 'ℹ️ Помощь':
- bot.send_message(message.chat.id, 'Привет, я бот, который поможет использовать Termux на все 100%!')
- bot.send_message(message.chat.id, 'Автор всех статей - @X_Selent')
- bot.send_message(message.chat.id, 'Автор бота - @d3fault_1, Значительная помощь в создании бота - @dazaiko')
- bot.send_message(message.chat.id, 'Чтобы начать пиши /start')
- if message.text == '💬 Оставить отзыв':
- bot.send_message(message.chat.id, '🔥 Напиши свой отзыв или идею по улучшению бота, и возможно автор воплотит твою задумку в жизнь!')
- bot.send_message(message.chat.id, 'Чтобы оставить отзыв напиши команду /comment')
- @bot.message_handler(commands=['help'])
- def handle_help(message):
- bot.send_message(message.chat.id, 'Привет, я бот, который обеспечит тебя минимальной анонимностью!')
- bot.send_message(message.chat.id, 'Чтобы начать пиши /start')
- if __name__ == '__main__':
- bot.polling(none_stop=True)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement