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

doggoreportbot

v5.0.3

Published

Telegram bot

Downloads

4

Readme

🐶 DoggoReportBot 🐾

A Telegram bot coded in NodeJS, which allows admins of a channel to communicate with several users by using the bot as an intermediary.

⚙️ How to run the bot

Requirements to run the bot: NodeJS. If you are unsure which version to choose, you should probably stick with the LTS version.

  1. Read Dev Infos below (do not skip this step)
  2. If you don't have git, install it
  3. Clone the repo executing: git clone https://github.com/Croluy/DoggoReportBot (check this for troubleshooting)
  4. Create a .env file inside the root directory of the bot
  5. Insert your infos in your local .env file
  6. Set bot_test to false in your local index.js file
  7. In your terminal, navigate to the root directory of the bot
  8. Execute npm start

If you have set up the bot correctly you should get a message from it asking you if the channel name is correct. You should also see that the bot sent a message to the log channel informing you it is online.

💻 Dev Infos

⚠️ IMPORTANT I have excluded some files when uploading the project to GitHub. Those include data I won't disclose publicly for obvious reasons. You will have to manually create and insert that data inside the ".env" file. I have prepared a template file that you can copy-paste inside your .env file and down below you have a description of each line so you know how it has to be edited.

  • Bot Token: It is the token of the bot provided to you by BotFather on Telegram. It is a secret code that gives full access to the bot. Has to be in quotes (or double quotes): ".
  • Creator ID: Your Telegram ID. You can get your ID with this tutorial or just Google "get personal telegram id".
  • Creator Name: It is your Telegram name/username. Has to be in quotes (or double quotes): ".
  • Log Channel: ID of the channel where the bot will log its more important actions. You have to be creator of this channel and to get its ID you can use this tutorial or just Google "get telegram channel id".
  • Channel Name: It is the name of the channel linked to your bot. NOT the log channel but the channel this bot is linked. Has to be in quotes (or double quotes): ".

When running the bot be sure to set the variable bot_test to false in "index.js". That will deny the bot from skipping some initial steps that I've preferred ignoring during development process. This will also create 2 JSON files on your local machine:

  • blacklist.json --> it saves a list of all users banned from the bot;
  • admins.json --> this file saves a list of all the admins of the bot.

Do NOT delete or manually modify these files unless you know what you're doing!

If you have messed up any of those files and can't restore them, you will have to fully reset them:

  1. Stop the bot execution if it's currently running;
  2. Delete both blacklist.json and admins.json files;
  3. Make sure bot_test variable in "index.js" is set to false;
  4. Run the bot again.

After executing this steps the two files will be restored, but all the previous saved infos (such as admin or banned users) will be lost. You will have to promote again all the users you want as admins and ban again all users you have previously banned.


All the messages that the bot sends to users and admins are stored in "BotReplies.json". The JSON is organized following a Tree Structure where the roots are functions and index and each of them represents a JS file ("index.js" and "functions.js"). Both roots have a list of children named the same as that file's functions where messages are sent from the bot to anyone. This allows the project to be more organized. If you wish to edit some of those messages, ideally you should only be editing BotReplies.json avoiding to create bugs inside the other files where functions are implemented.

🧬 Features

When an user sends any message to the bot, that message will be forwarded to all the current Administrators. That's right! This bot supports multiple admins. Not only that, but there are 3 diffent ranks of Administrators:

  • 👑 Bot's Owner (also mentioned as Creator) is the highest rank and has access to ALL the commands, there can only be 1 Bot Owner;
  • 💎 Superior Administrator it's the max rank any user (who isn't Bot's Owner) can aspire to, it has a high amount of available commands;
  • 👮‍♀️ Administrator is a user who has Ban power over normal users.

Administrators can reply to users by simply using the reply function of Telegram. When that happens, said reply will be forwarded to all the other Administrators of the bot also.

If users restrict their forwarding privacy setting, the bot has to use some tricks to get around the problem as some functions might work slightly diffentely than normal. Having this said, at the moment, ALL of the features and commands of this bot are usable even with this category of users.

If any errors occour during the use of the bot, it will log those errors on a log channel you've chosen, which is different from the channel this bot is supposed to be linked with. The Telegram log channel has to be created manually by you and it should only be visible to people you have granted Administrator permission to.

💡 Commands

You can get a list of all the commmands available to you by running /commands in the bot chat. I have listed the most useful commands below and I've used emojis to also show what kind of rank is required for that command to work. Obviously all lower ranked commands can be executed by higher ranked Administrators too.

  • 👮‍♀️ Ban OR Terminate: ban any user who texts the bot and their messages will be completely ignored until you choose to Unban said user. You can Ban only by replying to user's message.

    Ban Example GIF


  • 👮‍♀️ Unban: unban an user that has previously been banned from using the bot. It allows said user to be able to use the bot again. You can Unban by either replying to user's message OR by using the user's ID.

    Unban Example GIF


  • 👮‍♀️ Blacklist: show a list of all users who are Banned from the bot. You can run Blacklist command only by typing it in bot's chat as a normal message.

    Blacklist Example GIF


  • 💎 Adminlist: show a list of all Administrators of the bot. You can run Adminlist command only by typing it in bot's chat as a normal message.

    Adminlist Example GIF


  • 💎 Admin: promote a normal user to Admininistrator. You can run Admin only by replying to user's message.

    Admin Example GIF


  • 💎 Unadmin OR Demote: demote users of their current Administrator rank to the lower rank. Obviously if you are a Superior Admin you can only demote Admins back to users, but you can't demote other Superior Admins. You can Demote by either replying to user's message OR by using the user's ID.

    Demote Example GIF


  • 💎 Info: gather some infos about a specific user. Those include: ID, Full Name, Username (if any) and Language code. You can run Info only by replying to user's message.

    Info Example GIF


  • 💎 SetUsername: set the username of the channel this bot is linked to. You can run this command followed by the new username of the linked channel.

    SetUsername Example GIF


  • 👑 Promote OR Superior: grant an Administrator the Superior Administrator rank. You can run this command followed by Admin's ID.

    Promote Example GIF


  • 👑 ResetAdmins: resets the list of ALL the admins by removing every single one of them except the Bot's Owner. You can run Blacklist command only by typing it in bot's chat as a normal message.

    ResetAdmins Example GIF

📄 Credits:

:rocket: Created and Maintained by Croluy