npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@ptkdev/node-telegram-bot-boilerplate

v1.0.20211121

Published

Create your telegram bot with this friendly boilerplate. Use this repository as template for your bot

Downloads

50

Readme

🤖 node-telegram-bot-boilerplate

v1.0.20211121 License: MIT Language: TypeScript ECMAScript: 2019 Discord Server

Create your telegram bot with this friendly boilerplate. Use this repository as a template for your bot

This is a github template, you can fork it or use it as a template to start a new project with this repository as hello-world. I hate to start a new project with an empty template, often I miss correct configuration, readme instruction or I need samples of code. Use this repository as a template to solve this problem.

🎁 Support: Donate

This project is free, open source and I try to provide excellent free support. Why donate? I work on this project for several hours in my spare time and try to keep it up to date and working. THANK YOU!

Donate Paypal Donate Ko-Fi Donate Github Sponsors Donate Patreon Donate Bitcoin Donate Ethereum

📎 Menu

💡 Features

  • [✔️] Easy to use
  • [✔️] MIT License
  • [✔️] Make telegram bot with node
  • [✔️] Friendly boilerplate + Github templates
  • [✔️] Typescript + TSPaths preconfigured
  • [✔️] Userfriendly folders tree
  • [✔️] Prettify and ESLint preconfigured
  • [✔️] all-contributors-cli and all-shields-cli preconfigured
  • [✔️] JEST Test preconfigured
  • [✔️] Full async code
  • [✔️] Github and Vscode dotfiles preconfigured
  • [✔️] Translations: 🇬🇧 🇮🇹 🇵🇱 (Help me ❤️)

🔨 Developer Mode

🏁 Run Project

  1. Clone this repository or download nightly, beta or stable.
  2. Write to @botfather on telegram and create new bot (save token and set bot username)
  3. Run with correct values: npm run init:token --username name_bot --token 1234:asdfghjkl
  4. Run npm run init
  5. Run npm run dev
  6. Write /start on telegram bot.

💾 Setup Project

If you want to replace all strings (example: package name, author, URLs, etc...) in the markdown file, source files and others files of this project you need to edit setup.json with correct values and run npm run setup.

🪝 Configuring Webhooks

If you want to run the bot using webhooks you need to place your SSL certificate and Private key in the certs directory and configure the webhook object in the config file like:

webhook: {
 url: "https://my.host.com:8443", // or DNS name
 port: 8443,
 selfSigned: true
},

If you want to run the bot with your self-signed certificate selfSigned flag needs to be set to true, this will allow us to communicate to Telegram that our webhook server can be trusted. More information about webhooks with self-signed certificates can be found here

you can generate your self-signed certificate using the utility script:

npm run init:certs [common-name]

Replace common-name with the same host-name or IP address you are using in the webhook.url path of the config.js file

🖥️ Deploy

🚀 Native Run

Deploy bot to your server and:

  1. Run with correct values: npm run init:token --token asdfghjkl
  2. Run init npm run init
  3. Generate release npm run release
  4. Start bot npm run start-pm2

🐳 Docker

You can also release and run your bot as a Docker container.

docker run ptkdev/node-telegram-bot-boilerplate:<version>

where <version> can be one of the releases (ex. v1.0.0) or latest

For your convenience, in case you would like to run the bot in webhook mode, we have already exposed 8443 port on our docker files.

To change the configuration to match yours, just change the Dockerfile line with the EXPOSE instruction

EXPOSE 8443

in the end, you'll be able to expose the docker port using -p <port>:<host-port> docker parameter.

The preferred way to provide the configuration file is to mount the final configuration under /app/dist/configs/config.js:

docker run -v ${PWD}/app/configs/config.js:/app/dist/configs/config.js ptkdev/node-telegram-bot-boilerplate:<version>

Note: the docker images have been prepared for many architectures but have been tested mainly on amd64 architecture.

📚 Documentation

Run npm run docs

👑 Backers and Sponsors

Thanks to all our backers! 🙏 Donate 3$ or more on paypal, ko-fi, github or patreon and send me email with your avatar and url.

👨‍💻 Contributing

I ❤️ contributions! I will happily accept your pull request! Translations, grammatical corrections (GrammarNazi you are welcome! Yes my English is bad, sorry), etc... Do not be afraid, if the code is not perfect we will work together 👯 and remember to insert your name in .all-contributorsrc and package.json files.

Thanks goes to these wonderful people (emoji key):

💰 In the future, if the donations allow it, I would like to share some of the success with those who helped me the most. To me, Open Source means sharing code, development knowledge and also donations!

🦄 Other Projects

💫 License

  • Code and Contributions have MIT License
  • Images and logos have CC BY-NC 4.0 License
  • Documentations and Translations have CC BY 4.0 License
Copyleft (c) 2021 Patryk Rzucidło (@PTKDev) <[email protected]>