├── students.xlsx ├── test_for.xlsx ├── defaullt ├── img.png ├── __pycache__ │ ├── inline.cpython-39.pyc │ └── inline.cpython-311.pyc ├── default.py └── inline.py ├── images ├── 1photo.jpg ├── 2photo.jpg ├── 3photo.jpg ├── 4photo.jpg ├── 5photo.jpg ├── 6photo.jpg ├── 7photo.jpg ├── 8photo.jpg ├── 9photo.jpg └── 10photo.jpg ├── requirements.txt ├── .idea ├── vcs.xml ├── .gitignore ├── misc.xml ├── inspectionProfiles │ └── profiles_settings.xml ├── modules.xml └── marsrobot.iml ├── test.py └── main.py /students.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onlysharifjon/marsrobot/HEAD/students.xlsx -------------------------------------------------------------------------------- /test_for.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onlysharifjon/marsrobot/HEAD/test_for.xlsx -------------------------------------------------------------------------------- /defaullt/img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onlysharifjon/marsrobot/HEAD/defaullt/img.png -------------------------------------------------------------------------------- /images/1photo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onlysharifjon/marsrobot/HEAD/images/1photo.jpg -------------------------------------------------------------------------------- /images/2photo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onlysharifjon/marsrobot/HEAD/images/2photo.jpg -------------------------------------------------------------------------------- /images/3photo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onlysharifjon/marsrobot/HEAD/images/3photo.jpg -------------------------------------------------------------------------------- /images/4photo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onlysharifjon/marsrobot/HEAD/images/4photo.jpg -------------------------------------------------------------------------------- /images/5photo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onlysharifjon/marsrobot/HEAD/images/5photo.jpg -------------------------------------------------------------------------------- /images/6photo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onlysharifjon/marsrobot/HEAD/images/6photo.jpg -------------------------------------------------------------------------------- /images/7photo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onlysharifjon/marsrobot/HEAD/images/7photo.jpg -------------------------------------------------------------------------------- /images/8photo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onlysharifjon/marsrobot/HEAD/images/8photo.jpg -------------------------------------------------------------------------------- /images/9photo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onlysharifjon/marsrobot/HEAD/images/9photo.jpg -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onlysharifjon/marsrobot/HEAD/requirements.txt -------------------------------------------------------------------------------- /images/10photo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onlysharifjon/marsrobot/HEAD/images/10photo.jpg -------------------------------------------------------------------------------- /defaullt/__pycache__/inline.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onlysharifjon/marsrobot/HEAD/defaullt/__pycache__/inline.cpython-39.pyc -------------------------------------------------------------------------------- /defaullt/__pycache__/inline.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onlysharifjon/marsrobot/HEAD/defaullt/__pycache__/inline.cpython-311.pyc -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Editor-based HTTP Client requests 5 | /httpRequests/ 6 | # Datasource local storage ignored files 7 | /dataSources/ 8 | /dataSources.local.xml 9 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/marsrobot.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /test.py: -------------------------------------------------------------------------------- 1 | bolakaylar = [ 2 | ['Dias Djumabayev', 642181, '90-988-46-73', 0], 3 | ['Mansur Muxtorov', 457658, '97-494-46-36', 0], 4 | ['Bekzod Xotamov', 335935, '97-115-53-00', 0], 5 | ['Maqsud Odilxo`jayev', 564850, '93-070-46-16', 0], 6 | ['Javoxir Maqsudov', 359725, '99-852-6943', 0], 7 | ['Maryambonu Mirzayeva', 336845, '90-321-8003', 1], 8 | ] 9 | 10 | 11 | print(bolakaylar[4][2]) 12 | id = int(input('modme ID ni kiriting: ')) 13 | count = 0 14 | for i in bolakaylar: 15 | count+=1 16 | if i[1] == id: 17 | print(count) 18 | print(i[0]) 19 | 20 | 21 | -------------------------------------------------------------------------------- /defaullt/default.py: -------------------------------------------------------------------------------- 1 | from aiogram.types import ReplyKeyboardMarkup, KeyboardButton 2 | 3 | asosiy_menu = ReplyKeyboardMarkup( 4 | resize_keyboard=True, 5 | keyboard=[ 6 | [ 7 | KeyboardButton(text='👨‍🎓Профиль'), 8 | KeyboardButton(text='🪙Мои монеты'), 9 | KeyboardButton(text='💥Space shop') 10 | ], 11 | [ 12 | KeyboardButton(text='🏫О школе'), 13 | KeyboardButton(text='✍️Оставить отзив') 14 | ] 15 | 16 | ] 17 | <<<<<<< HEAD 18 | ) 19 | ======= 20 | ) 21 | 22 | #salom1 23 | >>>>>>> 8df573efe78c78a400c19d088cb1b2f30955ecb0 24 | -------------------------------------------------------------------------------- /defaullt/inline.py: -------------------------------------------------------------------------------- 1 | from aiogram.types import InlineKeyboardMarkup, InlineKeyboardButton 2 | 3 | language = InlineKeyboardMarkup( 4 | inline_keyboard=[ 5 | [ 6 | InlineKeyboardButton(text="Uzb", callback_data="Uzbek"), 7 | InlineKeyboardButton(text="Eng", callback_data="English"), 8 | InlineKeyboardButton(text="Rus", callback_data="Russian") 9 | ], 10 | ], 11 | ) 12 | who = InlineKeyboardMarkup( 13 | inline_keyboard=[ 14 | [ 15 | InlineKeyboardButton(text='Ota Onaman', callback_data='ota'), 16 | InlineKeyboardButton(text='Studentman', callback_data='stud'), 17 | InlineKeyboardButton(text='Mehmonman', callback_data='meh'), 18 | ] 19 | ] 20 | ) 21 | 22 | important = InlineKeyboardMarkup( 23 | inline_keyboard=[ 24 | [ 25 | InlineKeyboardButton('-Mars Airpods-',callback_data='airpods' ), 26 | InlineKeyboardButton('-Mars Keyboards-',callback_data='keyboards') 27 | ], 28 | [ 29 | InlineKeyboardButton('-Mars Powerbank-',callback_data='powerbank'), 30 | InlineKeyboardButton('-Keyboards Sticker-',callback_data='sticker') 31 | ], 32 | [ 33 | InlineKeyboardButton('-Mars Watch-',callback_data='watch'), 34 | InlineKeyboardButton('-Mars Earphones-',callback_data='earphones') 35 | ], 36 | [ 37 | InlineKeyboardButton('-Mars Phone-',callback_data='phone'), 38 | InlineKeyboardButton('-Mars mini-',callback_data='mars_mini') 39 | ], 40 | [ 41 | InlineKeyboardButton('-Mars Sticker-',callback_data='sticker2'), 42 | InlineKeyboardButton('-Mars notebook-',callback_data='notebook') 43 | ] 44 | ] 45 | ) 46 | -------------------------------------------------------------------------------- /main.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | import openpyxl 4 | from aiogram import Bot, Dispatcher, types 5 | from aiogram.contrib.fsm_storage.memory import MemoryStorage 6 | from aiogram.contrib.middlewares.logging import LoggingMiddleware 7 | from aiogram.dispatcher import FSMContext 8 | from aiogram.dispatcher.filters.state import State, StatesGroup 9 | from aiogram.types import InputMediaPhoto 10 | 11 | from defaullt.default import asosiy_menu 12 | 13 | from defaullt.inline import language, who, important 14 | 15 | from defaullt.inline import language, who 16 | 17 | # Your Telegram API token 18 | TOKEN = '6514287083:AAF92CBSMQKpVXJM2gXwgSIfu7a5hceK5O0' 19 | # Initialize the bot and dispatcher 20 | bot = Bot(token=TOKEN,parse_mode='HTML') 21 | dp = Dispatcher(bot, storage=MemoryStorage()) 22 | logging.basicConfig(level=logging.INFO) 23 | 24 | # Middleware for logging 25 | dp.middleware.setup(LoggingMiddleware()) 26 | DATABASE_DICT = {} 27 | 28 | 29 | class Mars(StatesGroup): 30 | uzb_lang = State() 31 | modme = State() 32 | asosiy_men_state = State() 33 | 34 | space_shop = State() 35 | 36 | 37 | # Echo handler 38 | @dp.message_handler(commands=['start', 'help']) 39 | async def send_welcome(message: types.Message): 40 | await message.answer( 41 | "Mars botiga xush kelibsiz! Iltimos, Til tanlang,\n\nДобро пожаловать в Mars Bot! Пожалуйста, " 42 | "выберите язык\n\nWelcome to Mars Bot! Please select a language", 43 | reply_markup=language) 44 | await Mars.uzb_lang.set() 45 | 46 | 47 | @dp.callback_query_handler(text='Uzbek', state=Mars.uzb_lang) 48 | async def uzb_l(call: types.CallbackQuery): 49 | await call.message.delete() 50 | await call.message.answer('Iltimos, kimligingizni ko`rsating))', reply_markup=who) 51 | 52 | 53 | @dp.callback_query_handler(text='stud', state=Mars.uzb_lang) 54 | async def student_login(call: types.CallbackQuery): 55 | await call.message.answer('Modme id ni kiriting: ') 56 | await call.message.delete() 57 | await Mars.modme.set() 58 | 59 | 60 | p = 0 61 | 62 | 63 | @dp.message_handler(content_types=types.ContentType.TEXT, state=Mars.modme) 64 | async def texter(message: types.Message, state: FSMContext): 65 | id_student = message.text 66 | wb = openpyxl.load_workbook('students.xlsx', 'rb') 67 | sheet = wb['Sheet'] 68 | users = [] 69 | for i in range(2, sheet.max_row + 1): 70 | users.append(sheet.cell(row=i, column=2).value) 71 | 72 | if int(id_student) in users: 73 | 74 | bolakaylar = [] 75 | for k in range(2, sheet.max_row + 1): 76 | _ = [] 77 | for p in range(1, 5): 78 | 79 | _.append(sheet.cell(row=k, column=p).value) 80 | if _ not in bolakaylar: 81 | bolakaylar.append(_) 82 | 83 | async def adder(): 84 | for t in bolakaylar: 85 | if str(t[1]) == str(id_student): 86 | t.remove(0) 87 | t.append(1) 88 | count = 0 89 | for sim in bolakaylar: 90 | count += 1 91 | print(count) 92 | if sim[1] == int(id_student): 93 | if bolakaylar[count - 1][-1] == 1: 94 | await message.answer('Bunday Akkaunt Oldin ro`yxatdan o`tgan') 95 | await Mars.uzb_lang.set() 96 | elif bolakaylar[count - 1][-1] == 0: 97 | await message.answer('Muvaffaqiyatli kirdingiz', reply_markup=asosiy_menu) 98 | DATABASE_DICT[message.from_user.id] = int(id_student) 99 | 100 | await state.finish() 101 | await Mars.asosiy_men_state.set() 102 | print(DATABASE_DICT) 103 | 104 | await adder() 105 | 106 | else: 107 | await message.answer('Tizimda qandaydir nosozlik!') 108 | 109 | 110 | await state.finish() 111 | await Mars.asosiy_men_state.set() 112 | else: 113 | await message.answer('Bunday foydalanuvchi topilmadi!') 114 | 115 | 116 | @dp.message_handler(text='🏫О школе',state=Mars.asosiy_men_state) 117 | async def profil(message:types.message,state:FSMContext): 118 | photo = open('defaullt/img.png', 'rb') 119 | await message.answer_photo(photo=photo) 120 | await message.answer(''' 121 | 👨🏻‍💻 Hamma kasb yaxshi, xavfsizi undan yaxshi! 122 | 123 | Havola orqali o’ting va videoni tomosha qiling: 124 | https://www.instagram.com/p/CxYJKchiR9x/ 125 | 126 | 127 | 🥊 Boks sport turini sevuvchi har bir odam, hayotida bir marotaba bo'lsa ham professional bokschi bo'lishni orzu qilgan, lekin bu sport har birimizga ham to’g'ri kelmaydi. «Mars IT School» sizning farzandingiz hayotiga kamroq xavf tug’diradigan va zamonaviy kasblarni qulay hamda qiziqarli holda taqdim etib, kelajakda o’z kasbining egasi bo'lishiga yordam beradi. 128 | 129 | 🤝 Tanlovda adashmang, farzandingiz uchun hozirdan mustahkam poydevor quring! 130 | 131 | 📩 Yunusobod filiali 132 | 📩 Tinchlik filiali 133 | 📩 Chilonzor-Qutbiniso filialil; 134 | 📩 Chilonzor 18 filiali 135 | 136 | 👇🏻 Hoziroq izohlarda "+" belgisini qoldiring va biz siz bilan bog'lanamiz! 137 | 138 | «Mars IT School» — bu kelajak! 139 | 140 | 📞 78-777-77-57 141 | ''') 142 | 143 | 144 | 145 | @dp.message_handler(text='💥Space shop',state=Mars.asosiy_men_state) 146 | async def photo(message: types.Message): 147 | photos = [ 148 | InputMediaPhoto(open('images/1photo.jpg', 'rb'),), 149 | InputMediaPhoto(open('images/2photo.jpg', 'rb')), 150 | InputMediaPhoto(open('images/3photo.jpg', 'rb')), 151 | InputMediaPhoto(open('images/4photo.jpg', 'rb')), 152 | InputMediaPhoto(open('images/5photo.jpg', 'rb')), 153 | InputMediaPhoto(open('images/6photo.jpg', 'rb')), 154 | InputMediaPhoto(open('images/7photo.jpg', 'rb')), 155 | InputMediaPhoto(open('images/8photo.jpg', 'rb')), 156 | InputMediaPhoto(open('images/9photo.jpg', 'rb')), 157 | InputMediaPhoto(open('images/10photo.jpg', 'rb')), 158 | ] 159 | await message.answer_media_group(media=photos) 160 | await message.answer('Выберите приз',reply_markup=important) 161 | 162 | 163 | 164 | #yangisi 165 | # man qaytim 166 | 167 | 168 | if __name__ == '__main__': 169 | from aiogram import executor 170 | 171 | executor.start_polling(dp, skip_updates=True) 172 | --------------------------------------------------------------------------------