This commit is contained in:
@ -173,8 +173,9 @@ async def process_answer(message: Message, state: FSMContext):
|
|||||||
gift.picture = message.photo[-1].file_id
|
gift.picture = message.photo[-1].file_id
|
||||||
|
|
||||||
|
|
||||||
|
text = gift_text(gift, message.from_user.id)
|
||||||
if gift.picture is None:
|
if gift.picture is None:
|
||||||
await message.answer(f"{gift.name}\n{gift.description}\n{gift.link}")
|
await message.answer(text)
|
||||||
try:
|
try:
|
||||||
cur.execute(
|
cur.execute(
|
||||||
f"INSERT OR IGNORE INTO gifts(name, description, link) VALUES(?, ?, ?)",
|
f"INSERT OR IGNORE INTO gifts(name, description, link) VALUES(?, ?, ?)",
|
||||||
@ -184,7 +185,7 @@ async def process_answer(message: Message, state: FSMContext):
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(e)
|
print(e)
|
||||||
else:
|
else:
|
||||||
await message.answer_photo(photo = gift.picture, caption=f"{gift.name}\n{gift.description}\n{gift.link}")
|
await message.answer_photo(photo = gift.picture, caption=text)
|
||||||
try:
|
try:
|
||||||
cur.execute(
|
cur.execute(
|
||||||
f"INSERT OR IGNORE INTO gifts(name, description, link, picture) VALUES(?, ?, ?, ?)",
|
f"INSERT OR IGNORE INTO gifts(name, description, link, picture) VALUES(?, ?, ?, ?)",
|
||||||
|
|||||||
Reference in New Issue
Block a user