Created
May 10, 2023 13:45
-
-
Save fitwist/5d0eb1509976d52063633f10063f61b5 to your computer and use it in GitHub Desktop.
Aiogram: хэндлер разметки
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@dp.message_handler(commands=['start'], state=None) | |
async def start(message: types.Message, state: FSMContext): | |
'''Точка входа''' | |
tg_id = message.chat.id | |
name = message.from_user.first_name | |
full_name = message.from_user.full_name | |
reg = re.compile('[^\w 0-9 \.,]') | |
f_name = reg.sub('', full_name) | |
login = f'@{message.from_user.username}' | |
db.registration(tg_id, f_name, login) | |
# через regex | |
reg = re.compile('[^\w 0-9 \.,]') | |
f_name = reg.sub('', full_name) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment