bot.edit_message_text(chat_id=call.message.chat.id, message_id=call.message.id, text='Новый текст')
bot.edit_message_media(chat_id=call.message.chat.id, message_id=call.message.id, media=types.InputMediaPhoto(open('file.jpg','r').read(), caption='Новая картинка'))
$ file core.666
core.666: ELF 64-bit LSB core file, x86-64, version 1 (SYSV), SVR4-style, from '/usr/bin/foobar', real uid: 0, effective uid: 0, real gid: 0, effective gid: 0
gdb -c core.666
$ docker pull alpine
Using default tag: latest
latest: Pulling from library/alpine
540db60ca938: Pull complete
Digest: sha256:69e70a79f2d41ab5d637de98c1e0b055206ba40a8145e7bddb55ccc04e13cf8f
Status: Downloaded newer image for alpine:latest
docker.io/library/alpine:latest
$ docker tag alpine foo/bar/lorem/ipsum:some.tag
$ docker rmi alpine
Untagged: alpine:latest
Untagged: alpine@sha256:69e70a79f2d41ab5d637de98c1e0b055206ba40a8145e7bddb55ccc04e13cf8f
$ docker rmi foo/bar/lorem/ipsum:some.tag
Untagged: foo/bar/lorem/ipsum:some.tag
Deleted: sha256:6dbb9cc54074106d46d4ccb330f2a40a682d49dda5f4844962b7dce9fe44aaec
Deleted: sha256:b2d5eeeaba3a22b9b8aa97261957974a6bd65274ebd43e1d81d0a7b8b752b116
from my_awesome_module import my_awesome_function
from flask import Flask, request, Response, abort
app = Flask(__name__)
@app.route('/', methods=['GET'], defaults={'path': ''})
@app.route('/<path:path>', methods=['GET'])
def serve(path):
result = my_awesome_function(path)
if result == 0:
return Response("OK")
else:
return abort(500)
if __name__ == '__main__':
app.run(host='0.0.0.0', port=123456)
#
numbers = items.keys()
index_current = numbers.index(number_current)
if index_current > 0:
number_prev = numbers[index_current-1]
else:
number_prev = numbers[-1]
if index_current < len(numbers)-1:
number_next = numbers[index_current+1]
else:
number_next = numbers[0]
next =InlineKeyboardButton(text= 'Следующий',callback_data= f'item:{number_next}')
previous =InlineKeyboardButton(text= 'Предыдущий',callback_data= f'item:{number_prev}')
add = InlineKeyboardButton(text= 'Добавить в корзину',callback_data= f'add:{number_current}')
...
if call.data.startswith('item:'):
number_current = call.data[5:]
show_this_item_to_user
if call.data.startswith('add:'):
number_current = call.data[4:]
add_this_item_to_basket
async def main():
polling_task = asyncio.create_task(dp.start_polling())
while True:
await asyncio.sleep(60)
await bot.send_message(owner, "Hello!")
loop = asyncio.get_event_loop()
if __name__ == '__main__':
loop.run_until_complete(main())
loop.close()
{{ url_for('static' filename='...')|safe }}