Compare commits

9 Commits

Author SHA1 Message Date
b313b15686 Test fix nft_svc
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is failing
2022-05-08 01:11:56 +07:00
aacb413176 Some fix
All checks were successful
continuous-integration/drone/push Build is passing
2022-05-08 01:06:05 +07:00
efc711cd3b Added jpeg to png converted images
All checks were successful
continuous-integration/drone/push Build is passing
2022-05-08 01:02:04 +07:00
b77f1bc13d Remove jpeg's
All checks were successful
continuous-integration/drone/push Build is passing
2022-05-08 00:49:08 +07:00
55f17606d6 Merge branch 'main' of https://gitea.gavt45.ru/gav/es-bot
All checks were successful
continuous-integration/drone/push Build is passing
2022-05-08 00:44:41 +07:00
e0c9aad35a Update pictures 2022-05-08 00:44:19 +07:00
gav
8c558f7bc0 Merge pull request 'Job of fucking copywriter!!!' (#4) from text-edition into main
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #4
Reviewed-by: gav <a@a.aa>
2022-05-05 12:13:54 +07:00
gav
a66fde985f Merge branch 'main' into text-edition
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2022-05-05 12:13:24 +07:00
ee834376db Job of fucking copywriter!!!
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2022-05-04 22:05:35 +07:00
347 changed files with 275 additions and 773 deletions

View File

@ -102,9 +102,11 @@ FAV_THEME = "Какая школьная дисциплина нравится
FAV_THEME_KB = Keyboard() FAV_THEME_KB = Keyboard()
FAV_THEME_KB.add_text_button(text="Математика", payload={"q": "Математика"}, color=ButtonColor.PRIMARY) FAV_THEME_KB.add_text_button(text="Математика", payload={"q": "Математика"}, color=ButtonColor.PRIMARY)
FAV_THEME_KB.add_text_button(text="Русский/Литература", payload={"q": "русскийлитра"}, color=ButtonColor.PRIMARY) FAV_THEME_KB.add_text_button(text="Русский/Литература", payload={"q": "русскийлитра"}, color=ButtonColor.PRIMARY)
FAV_THEME_KB.add_text_button(text="Информатика/программирование", payload={"q": "Инфа"}, color=ButtonColor.PRIMARY)
FAV_THEME_KB.add_row() FAV_THEME_KB.add_row()
FAV_THEME_KB.add_text_button(text="Информатика/программирование", payload={"q": "Инфа"}, color=ButtonColor.PRIMARY)
FAV_THEME_KB.add_text_button(text="Физика", payload={"q": "Физика"}, color=ButtonColor.PRIMARY) FAV_THEME_KB.add_text_button(text="Физика", payload={"q": "Физика"}, color=ButtonColor.PRIMARY)
FAV_THEME_KB.add_row()
FAV_THEME_KB.add_text_button(text="История/обществознание", payload={"q": "Инфа"}, color=ButtonColor.PRIMARY)
FAV_THEME_KB.add_text_button(text="Другой", payload={"q": "other"}, color=ButtonColor.PRIMARY) FAV_THEME_KB.add_text_button(text="Другой", payload={"q": "other"}, color=ButtonColor.PRIMARY)
# 4 # 4
@ -131,7 +133,7 @@ ZODIAC = "Кто вы по знаку зодиака?"
# CONTACT = "Введите почту или ник в телеграмме, по которому мы сможем прислать вам результаты" # CONTACT = "Введите почту или ник в телеграмме, по которому мы сможем прислать вам результаты"
# last # last
LAST_MESSAGE = "Теперь у вас есть ваш персональный NFT-талисман! Он поможет вам при сдаче экзаменов и поступлении в желаемый ВУЗ &#127775;" LAST_MESSAGE = "Теперь у вас есть ваш персональный NFT-талисман! Он поможет вам при сдаче экзаменов и поступлении в желаемый университет &#127775;"
LAST_MESSAGE_KB = Keyboard() LAST_MESSAGE_KB = Keyboard()
LAST_MESSAGE_KB.add_text_button(text="Вернуться на главную", payload={}, color=ButtonColor.POSITIVE) LAST_MESSAGE_KB.add_text_button(text="Вернуться на главную", payload={}, color=ButtonColor.POSITIVE)

View File

@ -16,7 +16,7 @@ def open_image_as_array(path):
def get_encoded_img(arr): def get_encoded_img(arr):
img = Image.fromarray(arr).convert("L") img = Image.fromarray(arr)
img_byte_arr = io.BytesIO() img_byte_arr = io.BytesIO()
img.save(img_byte_arr, format='PNG') img.save(img_byte_arr, format='PNG')
encoded_img = base64.encodebytes(img_byte_arr.getvalue()).decode('ascii') encoded_img = base64.encodebytes(img_byte_arr.getvalue()).decode('ascii')
@ -26,13 +26,14 @@ def get_encoded_img(arr):
@app.route('/getImage', methods=['GET']) @app.route('/getImage', methods=['GET'])
def get_image(): def get_image():
# print(random.choice(os.listdir(IMAGE_PATH))) # print(random.choice(os.listdir(IMAGE_PATH)))
image = mpimg.imread(os.path.join(IMAGE_PATH, random.choice(os.listdir(IMAGE_PATH)))) file = os.path.join(IMAGE_PATH, random.choice(os.listdir(IMAGE_PATH)))
# buffered = io.BytesIO() # buffered = io.BytesIO()
# image.save(buffered, format="JPEG") # image.save(buffered, format="JPEG")
# img_str = base64.b64encode(buffered.getvalue()) # img_str = base64.b64encode(buffered.getvalue())
image = base64.encodebytes(open(file, 'rb').read()).decode('ascii')
return jsonify({ return jsonify({
"code": 0, "code": 0,
"image": get_encoded_img(image), "image": image,
"first_time": 1 "first_time": 1
}) })

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
nft_svc/pics/pic_0.jpg (Stored with Git LFS)

Binary file not shown.

BIN
nft_svc/pics/pic_1.jpg (Stored with Git LFS)

Binary file not shown.

BIN
nft_svc/pics/pic_10.jpg (Stored with Git LFS)

Binary file not shown.

BIN
nft_svc/pics/pic_100.jpg (Stored with Git LFS)

Binary file not shown.

BIN
nft_svc/pics/pic_101.jpg (Stored with Git LFS)

Binary file not shown.

BIN
nft_svc/pics/pic_102.jpg (Stored with Git LFS)

Binary file not shown.

BIN
nft_svc/pics/pic_103.jpg (Stored with Git LFS)

Binary file not shown.

BIN
nft_svc/pics/pic_104.jpg (Stored with Git LFS)

Binary file not shown.

BIN
nft_svc/pics/pic_105.jpg (Stored with Git LFS)

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More