Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

Sorry, you do not have permission to ask a question, You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please type your username.

Please type your E-Mail.

Please choose an appropriate title for the post.

Please choose the appropriate section so your post can be easily searched.

Please choose suitable Keywords Ex: post, video.

Browse

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Logo Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Logo

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Navigation

  • Home
  • About Us
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • About Us
  • Contact Us
Home/ Questions/Q 751

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Latest Questions

Author
  • 62k
Author
Asked: November 25, 20242024-11-25T01:46:10+00:00 2024-11-25T01:46:10+00:00

Making a Password Generator Bot in 9 Languages

  • 62k

Hey there DEV!

In this 9-part series, I wanted to explore what creating a simple password generator bot would be like, in 9 different programming languages.

You might be wondering why or well, why??. The simplest answer is that I thought it would be fun. In addition to being fun, it will most definitely be interesting. As you can imagine, reimplementing the same logic across different paradigms will be simultaneously tedious and insightful, the best learning environment.

We will start with Typescript and go on to implement the same bot in Golang, Python, Rust, etc. I chose the list of languages based primarily on my personal/professional experiences and their overall popularity in the industry.

As we switch languages and progress through the list, we will learn about different libraries and tools we can use to develop each unique implementation.

As you can imagine, there will be many cases where I will choose one library or package over another.

I will try to justify my decision-making where possible, but please keep in mind that often, I AM GOING FOR WHATEVER SEEMS EASIEST. The libraries I implement happen to be whatever I find to be easiest to use and set up. By selecting them, I am by no means declaring their superiority.

Here's the github link to the finished / in progress repo in case you want to just see the source code.

Why Telegram?

It is straightforward, has good support, and I have experience with the API. I would love to do future articles for other platforms, such as Discord and Slack but probably not in 9 different languages.

Getting a bot token

To authenticate your bot with the telegram bot API, we will acquire a bot token.

Obtaining a token is as simple as opening Telegram and contacting @botfather, issuing the /newbot command, and following the steps until you receive a new token. You can find a step-by-step guide here.

Your token will look something like this:
4839574812:AAFD39kkdpWt3ywyRZergyOLMaJhac60qc

Store it somewhere safe. We will use this token for every implementation as it is necessary to communicate with your bot using the API.

So, what’s the bot?

A password generator telegram bot. What a mouthful.

Graph listing commands

Let's break it down

Okay, so, a bot with a /start (duh), /generate, and /help command. You can guess what the /start and /help commands do, actually, you can guess what all the commands do, that’s kind of the point of commands.

The /generate command will generate an AlphaNumeric + Symbol containing 12 character string. The command will also support providing a number parameter specifying the length of the generated password.

/generate 15 > AF42F$dw33EDFA3 
Enter fullscreen mode Exit fullscreen mode

That’s it. Simple right?

Well, one last thing, let me explain how we will actually generate the password.

Basic Password Generation

We will store a string containing all the characters we want to be in the password. This string will go something like “ABCD…-=”. Let’s call this KeyString.

When a user prompts for a new password (assuming no length parameter is specified) we will randomly select a character from the KeyString variable 12 times and concatenate the characters into a new variable, RandString. We will then message the user the newly generated RandString.

I’ve complicated this section a fair bit but it’s easy to imagine the bot gets a lot more useful and complicated. We can even add additional functionality such as password strength evaluation, memorable passwords, and so on. Again, we will go for the simplest path, which is also why mostly use built-in randomization functions.

And that’s all there is to it.

Although I will be implementing only the functionality described above, I highly encourage you to experiment and see what works and does not. That is truly the best way to learn.

Here is the list of languages as of this writing, in (hopefully) sequential order.

💙 TypeScript
🐹 Golang
🐍 Python
🦀 Rust
🔷 C#
💎 Ruby
🐪 Perl
🐘 PHP
☕ Java

Before we start, here’s a little disclaimer

What this series isn’t

This series will not attempt to be something like “The Ultimate Guide To Telegram Bot Development” for any programming language. It may serve as a quick reference on telegram bot development but only for projects with minuscule scopes.

This series will not attempt to rank and hierarchically compare various programming languages if there are comparisons at all. Implementations will be an attempt to adapt and engineer, not critique.

beginnersbottelegramwebdev
  • 0 0 Answers
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

Sidebar

Ask A Question

Stats

  • Questions 4k
  • Answers 0
  • Best Answers 0
  • Users 1k
  • Popular
  • Answers
  • Author

    How to ensure that all the routes on my Symfony ...

    • 0 Answers
  • Author

    Insights into Forms in Flask

    • 0 Answers
  • Author

    Kick Start Your Next Project With Holo Theme

    • 0 Answers

Top Members

Samantha Carter

Samantha Carter

  • 0 Questions
  • 20 Points
Begginer
Ella Lewis

Ella Lewis

  • 0 Questions
  • 20 Points
Begginer
Isaac Anderson

Isaac Anderson

  • 0 Questions
  • 20 Points
Begginer

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help

Footer

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise

Querify Question Shop: Explore, ask, and connect. Join our vibrant Q&A community today!

About Us

  • About Us
  • Contact Us
  • All Users

Legal Stuff

  • Terms of Use
  • Privacy Policy
  • Cookie Policy

Help

  • Knowledge Base
  • Support

Follow

© 2022 Querify Question. All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.