Telegram Password Bot - this telegram bot for generating passwords with 8/16/32 symbols and which uses pyTelegramBotAPI 4.27.0
API Documentation - https://pytba.readthedocs.io/en/latest/index.html
Install the current version PyPI:
pip install pyTelegramBotAPI
or with Git:
pip install git+https://github.com/eternnoir/pyTelegramBotAPI.git
- Create Virtualenv environment (Venv).
- Create Telegram Bot in
@BotFather
, take API token, then paste it instead "bot's API"
bot = telebot.TeleBot("bot's API")
- Also if you want you can write /setcommands in
@BotFather
, choose your bot and set comand "start - start", in order to when you enter bot at first, in the left corner was shown menu with command "/start".
This Bot uses module secrets to generate passwords.
def gen_password(len):
a = "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM0123456789'[]{},./_-()"
return "".join(secrets.choice(a)for i in range(len))
It also has generation with only letters, numbers and symbols.
def only_numbers(len):
num = "0123456789"
return "".join(secrets.choice(num)for i in range(len))
def only_letters(len):
a = "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM"
return "".join(secrets.choice(a) for i in range(len))
def only_symbols(len):
sym = "'[]{},./_-()"
return "".join(secrets.choice(sym) for i in range(len))