Skip to content

Instantly share code, notes, and snippets.

View dantetemplar's full-sized avatar

Ruslan Bel'kov dantetemplar

View GitHub Profile
@dantetemplar
dantetemplar / 3.README-GIST.py
Last active July 19, 2024 00:59
Check Telegram WebAppData in Python
"""
Check Telegram WebAppData in Python
Based on https://core.telegram.org/widgets/login#checking-authorization
"""
import hashlib
import hmac
import json
@dantetemplar
dantetemplar / 2.README-GIST.md
Last active March 15, 2024 11:50
Aiogram 3 log messages and handlers

Aiogram 3 log messages and handlers

Warning

Tested on aiogram=3.3.0, code may failed with another version as it uses tricky things

Features

изображение

Automatically log every action from user

Each user action will be displayed in a log stream with the appropriate type (Message, CallbackQuery and so on).

@dantetemplar
dantetemplar / 1.README-GIST.md
Last active July 6, 2024 14:59
Async alembic configuration

Async alembic configuration

Features

Database connection from settings.yaml

You don't need to change alembic.ini to set up a database connection. Alembic will derive database connection uri from settings.yaml (or any yaml which you specify in SETTINGS_PATH environment variable).

Example of settings.yaml: