def command_text_hi(message): bot.send_message(message.chat.id, "Hi! What`s problem dude ?\nYou can ask any question.") DataBase.db_insert([ None, message.chat.first_name, message.chat.username, message.chat.id, message.from_user.language_code ])
def ignore_user_command(message): bot.send_message( message.chat.id, 'Do not spam with commands :D\nMy father Cyber Defender!') DataBase.db_insert([ None, message.chat.first_name, message.chat.username, message.chat.id, message.from_user.language_code ])
def show_faq(message): keyboard = telebot.types.InlineKeyboardMarkup() url_button = telebot.types.InlineKeyboardButton( text="Minerboard FAQ", url="https://minerboard.com/faq.html") keyboard.add(url_button) bot.send_message(message.chat.id, faq_message, reply_markup=keyboard) DataBase.db_insert([ None, message.chat.first_name, message.chat.username, message.chat.id, message.from_user.language_code ])
def start_dialogue(message): markup = telebot.types.ReplyKeyboardMarkup(one_time_keyboard=False, resize_keyboard=True) list_items = [ 'FAQ', ] for item in list_items: markup.add(item) DataBase.db_insert([ None, message.chat.first_name, message.chat.username, message.chat.id, message.from_user.language_code ]) bot.send_message(message.chat.id, reply_markup=markup, text=greeting_info)
def receive_to_user(message): bot.send_message( admin_chat, '{0}\n{1}\n@{2}\nlang: {4}\n/say{3}'.format( message.text, message.chat.first_name, message.chat.username, message.chat.id, message.from_user.language_code)) DataBase.db_insert([ None, message.chat.first_name, message.chat.username, message.chat.id, message.from_user.language_code ]) bot.send_message( message.chat.id, 'Your request is confirmed. Our team will get in touch with you as soon as possible.' )
def receive_help_info(message): keyboard = telebot.types.InlineKeyboardMarkup() mbrd_web_button = telebot.types.InlineKeyboardButton( text="Minerboard web-site", url="https://minerboard.com") mbrd_bctk_button = telebot.types.InlineKeyboardButton( text="Minerboard bitcointalk", url= "https://bitcointalk.org/index.php?topic=2379339.msg24291948#msg24291948" ) keyboard.add(mbrd_web_button, mbrd_bctk_button) bot.send_message(message.chat.id, help_info, reply_markup=keyboard) DataBase.db_insert([ None, message.chat.first_name, message.chat.username, message.chat.id, message.from_user.language_code ])
def get_user_photo(message): cid = message.chat.id try: fileID = message.photo[-1].file_id file_info = bot.get_file(fileID) downloaded_file = bot.download_file(file_info.file_path) image = config.image_path + str(cid) + '.jpg' with open(image, 'wb') as new_file: new_file.write(downloaded_file) bot.send_message(cid, 'Ok. photo has been grabbed') bot.send_photo( admin_chat, open(image, 'rb'), '{0}\n@{1}\n/say{2}'.format(message.chat.first_name, message.chat.username, message.chat.id)) DataBase.db_insert([ None, message.chat.first_name, message.chat.username, message.chat.id, message.from_user.language_code ]) except Exception: bot.send_message(cid, 'Sorry, photo has not grabbed')