# -*- coding: utf-8 -*- """Special module for all /start commands""" from view.output import send, reply, register_handler from presenter.config.log import Logger, LOG_TO import presenter.config.files_paths as files from presenter.config.config_var import ADEQUATE_KEYBOARD, ADAPT_ADEQUATE_KEYBOARD, CREATOR_ID from presenter.config.config_func import get_languages WORK = True LOG = Logger(LOG_TO) def new_option(message, vote_id): """Send option to De'Max to check if it's adequate""" LOG.log(str(message.from_user.id) + ": new_option invoked") send(CREATOR_ID, "[{}, '{}']".format(vote_id, message.text), reply_markup=ADEQUATE_KEYBOARD) reply(message, "Ваше мнение выслано на проверку") def new_adapt_option(message, vote_id): """Send option to De'Max to check if it's adequate""" LOG.log(str(message.from_user.id) + ": new_adapt_option invoked") send(CREATOR_ID, "[{}, '{}']".format(vote_id, message.text), reply_markup=ADAPT_ADEQUATE_KEYBOARD) reply(message, "Ваше мнение выслано на проверку")
from random import choice from collections import Counter, defaultdict from view.output import reply, send_photo, send_sticker, send, send_video, send_document from presenter.config.config_func import member_update, \ is_suitable, feature_is_available, get_system_configs, get_systems_json, get_person, \ get_list_from_storage, person_link, \ html_cleaner, link_text_wrapper, value_marker, get_storage_json from presenter.config.database_lib import Database from presenter.config.config_var import admin_place, \ MONTHS_GENITIVE, MONTHS_PREPOSITIONAL, FEATURES, FEATURES_TEXTS from presenter.config.languages import get_word_object from presenter.config.log import Logger from presenter.config.texts import MINETS LOG = Logger() def helper(message): """Предоставляет человеку список команд""" LOG.log(str(message.from_user.id) + ": helper invoked") database = Database() answer = '<b>Команды:</b>\n\n' if message.chat.id < 0: # Command is used in chat system = database.get('chats', ('id', message.chat.id))['system'] answer += '<b>Общие команды:</b>\n' \ '/me - Присылает вашу запись в базе данных\n' \ '/anon - Прислать анонимное послание в админский чат (если таковой имеется)\n' \ '/members - Прислать в личку перечень участников (нынешних и бывших) и их ID\n' \ '/messages_top - Прислать в личку топ участников по сообщениям\n' \ '/warns - Посмотреть, у кого сколько предупреждений\n\n'
from presenter.config.token_manager import BOT from presenter.config.log import Logger import requests LOG = Logger(0) # int code for log_to_both def request_file(file_id, save_as): file_info = BOT.get_file(file_id) req = requests.get("https://api.telegram.org/file/bot{0}/{1}".format( BOT.token, file_info.file_path)) file_out = open("input+" + file_info.file_path, "w") lines = req.content() file_out.write(lines) req.close() file_out.close()