diff --git a/SlashBot.py b/SlashBot.py index 6c4fb57..838995b 100644 --- a/SlashBot.py +++ b/SlashBot.py @@ -1,5 +1,8 @@ import os import re +from typing import List, Dict, Union + +import requests from telegram.ext import Updater, MessageHandler, filters TELEGRAM = 777000 @@ -15,6 +18,12 @@ else: raise Exception('no token') +# Find someone's full name by their username +def find_name_by_username(username: str) -> str: + r = requests.get(f'https://t.me/{username}') + return re.search('(?<=