예제 #1
0
from aiogram.types import CallbackQuery

from encyclopedia_all_files.Encyclopedia_District.Soviet_region.photos import Sovet_photo1, Sovet_photo2, Sovet_photo3, \
    Sovet_photo4, Sovet_photo5
from encyclopedia_all_files.Encyclopedia_District.Soviet_region.text import Sovet_text_1, Sovet_text_2, Sovet_text_3, \
    Sovet_text_4, Sovet_text_5
from handlers.users.encyclopedia import a
from keyboards.inline.callback_datas import place_callback
from keyboards.inline.encyclopedia import soviet_keyboard
from loader import dp, photo_db


@dp.callback_query_handler(place_callback.filter(item_name="sov_r"))
async def sov_region(call: CallbackQuery, callback_data: dict):
    await call.answer(cache_time=60)
    await call.message.answer("Советский район\n", reply_markup=soviet_keyboard)


@dp.callback_query_handler(place_callback.filter(item_name="1"))
async def sov_1(call: CallbackQuery, callback_data: dict):
    await call.answer(cache_time=60)
    if len(a) < len(Sovet_photo1):
        await call.message.answer_photo(photo=open(photo_db.get_one_file_name(name=Sovet_photo1[len(a)]), 'rb'))
        await call.message.answer(text=Sovet_text_1[len(a)])
    else:
        await call.message.answer("больше нет😔")


@dp.callback_query_handler(place_callback.filter(item_name="2"))
async def sov_2(call: CallbackQuery, callback_data: dict):
    await call.answer(cache_time=60)
예제 #2
0
from aiogram.types import CallbackQuery, InputMediaPhoto

from encyclopedia_all_files.Encyclopedia_District.Voroshilovsky_region.photos import Voroshil_photo, max_vor
from encyclopedia_all_files.Encyclopedia_District.Voroshilovsky_region.text import Voroshil_text
from handlers.users.encyclopedia import get_page
from keyboards.inline.callback_datas import place_callback, pagination_call
from keyboards.inline.encyclopedia import get_page_keyboard, get_text
from loader import dp, photo_db


@dp.callback_query_handler(place_callback.filter(item_name="vor_r"))
async def vor_region_pag(call: CallbackQuery, callback_data: dict):
    await call.answer(cache_time=2)
    text = get_page(Voroshil_text)
    photo = get_page(Voroshil_photo)
    await call.message.answer_photo(
        photo=open(photo_db.get_one_file_name(name=photo), 'rb'),
        reply_markup=get_page_keyboard(k="vor", max=max_vor))
    await call.message.answer(text=text,
                              reply_markup=get_text(max=max_vor, k="vor_t"))


@dp.callback_query_handler(pagination_call.filter(key="vor"))
async def show_current_page(call: CallbackQuery, callback_data: dict):
    await call.answer(cache_time=2)
    current_page = int(callback_data.get("page"))
    photo = get_page(array=Voroshil_photo, page=current_page)
    media = InputMediaPhoto(media=open(photo_db.get_one_file_name(
        name=photo), 'rb'))
    markup = get_page_keyboard(k="vor", max=max_vor, page=current_page)
    await call.message.edit_media(media=media, reply_markup=markup)
예제 #3
0
from aiogram.types import CallbackQuery

from encyclopedia_all_files.Encyclopedia_District.Kirovsky_region.photos import Kirovsky_photo1, Kirovsky_photo5, \
    Kirovsky_photo4, Kirovsky_photo3, Kirovsky_photo2
from encyclopedia_all_files.Encyclopedia_District.Kirovsky_region.text import Kirovsky_text1, Kirovsky_text2, \
    Kirovsky_text3, Kirovsky_text4, Kirovsky_text5
from handlers.users.encyclopedia import d
from keyboards.inline.callback_datas import place_callback
from keyboards.inline.encyclopedia import kirov_keyboard
from loader import dp, photo_db


@dp.callback_query_handler(place_callback.filter(item_name="kir_r"))
async def oct_region(call: CallbackQuery, callback_data: dict):
    await call.answer(cache_time=60)
    await call.message.answer("Кировский район\n", reply_markup=kirov_keyboard)


@dp.callback_query_handler(place_callback.filter(item_name="1kir"))
async def oct_1(call: CallbackQuery, callback_data: dict):
    await call.answer(cache_time=60)
    if len(d) < len(Kirovsky_photo1):
        await call.message.answer_photo(photo=open(photo_db.get_one_file_name(name=Kirovsky_photo1[len(d)]), 'rb'))
        await call.message.answer(text=Kirovsky_text1[len(d)])
    else:
        await call.message.answer("больше нет😔")


@dp.callback_query_handler(place_callback.filter(item_name="2kir"))
async def oct_2(call: CallbackQuery, callback_data: dict):
    await call.answer(cache_time=60)
예제 #4
0
from aiogram.types import CallbackQuery

from encyclopedia_all_files.Encyclopedia_District.Leninsky_region.photos import Lininsky_photo1, Lininsky_photo5, \
    Lininsky_photo4, Lininsky_photo3, Lininsky_photo2
from encyclopedia_all_files.Encyclopedia_District.Leninsky_region.text import Leninsky_text1, Leninsky_text2, \
    Leninsky_text3, Leninsky_text4, Leninsky_text5
from handlers.users.encyclopedia import e
from keyboards.inline.callback_datas import place_callback
from keyboards.inline.encyclopedia import len_keyboard
from loader import dp, photo_db


@dp.callback_query_handler(place_callback.filter(item_name="len_r"))
async def len_region(call: CallbackQuery, callback_data: dict):
    await call.answer(cache_time=60)
    await call.message.answer("Ленинский район\n", reply_markup=len_keyboard)


@dp.callback_query_handler(place_callback.filter(item_name="1len"))
async def len_1(call: CallbackQuery, callback_data: dict):
    await call.answer(cache_time=60)
    if len(e) < len(Lininsky_photo1):
        await call.message.answer_photo(photo=open(photo_db.get_one_file_name(name=Lininsky_photo1[len(e)]), 'rb'))
        await call.message.answer(text=Leninsky_text1[len(e)])
    else:
        await call.message.answer("больше нет😔")


@dp.callback_query_handler(place_callback.filter(item_name="2len"))
async def len_2(call: CallbackQuery, callback_data: dict):
    await call.answer(cache_time=60)
예제 #5
0
from aiogram.types import CallbackQuery

from encyclopedia_all_files.Encyclopedia_District.Railway_region.photos import Railway_photo1, Railway_photo5, \
    Railway_photo4, Railway_photo3, Railway_photo2
from encyclopedia_all_files.Encyclopedia_District.Railway_region.text import Railway_text1, Railway_text2, \
    Railway_text3, Railway_text4, Railway_text5
from handlers.users.encyclopedia import f
from keyboards.inline.callback_datas import place_callback
from keyboards.inline.encyclopedia import rai_keyboard
from loader import dp, photo_db


@dp.callback_query_handler(place_callback.filter(item_name="rai_r"))
async def rai_region(call: CallbackQuery, callback_data: dict):
    await call.answer(cache_time=60)
    await call.message.answer("Железнодорожный район\n",
                              reply_markup=rai_keyboard)


@dp.callback_query_handler(place_callback.filter(item_name="1rai"))
async def rai_1(call: CallbackQuery, callback_data: dict):
    await call.answer(cache_time=60)
    if len(f) < len(Railway_photo1):
        await call.message.answer_photo(
            photo=open(photo_db.get_one_file_name(
                name=Railway_photo1[len(f)]), 'rb'))
        await call.message.answer(text=Railway_text1[len(f)])
    else:
        await call.message.answer("больше нет😔")

예제 #6
0
from aiogram.types import CallbackQuery

from encyclopedia_all_files.Encyclopedia_District.Voroshilovsky_region.photos import Voroshil_photo1, Voroshil_photo5, \
    Voroshil_photo4, Voroshil_photo3, Voroshil_photo2
from encyclopedia_all_files.Encyclopedia_District.Voroshilovsky_region.text import Voroshil_text1, Voroshil_text2, \
    Voroshil_text3, Voroshil_text4, Voroshil_text5
from handlers.users.encyclopedia import g
from keyboards.inline.callback_datas import place_callback
from keyboards.inline.encyclopedia import vor_keyboard
from loader import dp, photo_db


@dp.callback_query_handler(place_callback.filter(item_name="vor_r"))
async def vor_region(call: CallbackQuery, callback_data: dict):
    await call.answer(cache_time=60)
    await call.message.answer("Ворошиловский район\n",
                              reply_markup=vor_keyboard)


@dp.callback_query_handler(place_callback.filter(item_name="1vor"))
async def vor_1(call: CallbackQuery, callback_data: dict):
    await call.answer(cache_time=60)
    if len(g) < len(Voroshil_photo1):
        await call.message.answer_photo(photo=open(
            photo_db.get_one_file_name(name=Voroshil_photo1[len(g)]), 'rb'))
        await call.message.answer(text=Voroshil_text1[len(g)])
    else:
        await call.message.answer("больше нет😔")


@dp.callback_query_handler(place_callback.filter(item_name="2vor"))
예제 #7
0
from aiogram.types import CallbackQuery

from encyclopedia_all_files.Encyclopedia_District.Proletarian_region.photos import Proletarian_photo1, Proletarian_photo5, \
    Proletarian_photo4, Proletarian_photo3, Proletarian_photo2
from encyclopedia_all_files.Encyclopedia_District.Proletarian_region.text import Proletarian_text1, Proletarian_text2, \
    Proletarian_text3, Proletarian_text4, Proletarian_text5
from handlers.users.encyclopedia import c
from keyboards.inline.callback_datas import place_callback
from keyboards.inline.encyclopedia import prolet_keyboard
from loader import dp, photo_db


@dp.callback_query_handler(place_callback.filter(item_name="prol_r"))
async def oct_region(call: CallbackQuery, callback_data: dict):
    await call.answer(cache_time=60)
    await call.message.answer("Пролетарский район\n", reply_markup=prolet_keyboard)


@dp.callback_query_handler(place_callback.filter(item_name="1pr"))
async def oct_1(call: CallbackQuery, callback_data: dict):
    await call.answer(cache_time=60)
    if len(c) < len(Proletarian_photo1):
        await call.message.answer_photo(photo=open(photo_db.get_one_file_name(name=Proletarian_photo1[len(c)]), 'rb'))
        await call.message.answer(text=Proletarian_text1[len(c)])
    else:
        await call.message.answer("больше нет😔")


@dp.callback_query_handler(place_callback.filter(item_name="2pr"))
async def oct_2(call: CallbackQuery, callback_data: dict):
    await call.answer(cache_time=60)
예제 #8
0
from aiogram.types import CallbackQuery

from encyclopedia_all_files.Encyclopedia_District.MayDay_region.photos import MayDay_photo1, MayDay_photo5, \
    MayDay_photo4, MayDay_photo3, MayDay_photo2
from encyclopedia_all_files.Encyclopedia_District.MayDay_region.text import MayDay_text1, MayDay_text2, \
    MayDay_text3, MayDay_text4, MayDay_text5
from handlers.users.encyclopedia import h
from keyboards.inline.callback_datas import place_callback
from keyboards.inline.encyclopedia import per_keyboard
from loader import dp, photo_db


@dp.callback_query_handler(place_callback.filter(item_name="perv_r"))
async def perv_region(call: CallbackQuery, callback_data: dict):
    await call.answer(cache_time=60)
    await call.message.answer("Первомайский район\n",
                              reply_markup=per_keyboard)


@dp.callback_query_handler(place_callback.filter(item_name="1per"))
async def perv_1(call: CallbackQuery, callback_data: dict):
    await call.answer(cache_time=60)
    if len(h) < len(MayDay_photo1):
        await call.message.answer_photo(
            photo=open(photo_db.get_one_file_name(
                name=MayDay_photo1[len(h)]), 'rb'))
        await call.message.answer(text=MayDay_text1[len(h)])
    else:
        await call.message.answer("больше нет😔")

예제 #9
0
from aiogram.types import CallbackQuery

from encyclopedia_all_files.Encyclopedia_District.October_region.photos import October_photo1, October_photo5, \
    October_photo4, October_photo3, October_photo2
from encyclopedia_all_files.Encyclopedia_District.October_region.text import October_text1, October_text2, \
    October_text3, October_text4, October_text5
from handlers.users.encyclopedia import b
from keyboards.inline.callback_datas import place_callback
from keyboards.inline.encyclopedia import oct_keyboard
from loader import dp, photo_db


@dp.callback_query_handler(place_callback.filter(item_name="oct_r"))
async def oct_region(call: CallbackQuery, callback_data: dict):
    await call.answer(cache_time=60)
    await call.message.answer("Октябрьский район\n", reply_markup=oct_keyboard)


@dp.callback_query_handler(place_callback.filter(item_name="1ok"))
async def oct_1(call: CallbackQuery, callback_data: dict):
    await call.answer(cache_time=60)
    if len(b) < len(October_photo1):
        await call.message.answer_photo(
            photo=open(photo_db.get_one_file_name(
                name=October_photo1[len(b)]), 'rb'))
        await call.message.answer(text=October_text1[len(b)])
    else:
        await call.message.answer("больше нет😔")


@dp.callback_query_handler(place_callback.filter(item_name="2ok"))