You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Faizan Akram Dar 8e557eca2b
Merge pull request #107 from thedevs-network/dependabot/npm_and_yarn/lodash-4.17.15
1 month ago
.circleci [ci] Added lint rule for CircleCI 1 year ago
actions Compact warn message (#89) 5 months ago
assets Localize logo file 1 year ago
bot Add -amend flag to /warn 6 months ago
handlers Add ban button to presence logger 5 months ago
plugins Don't assume config file extension 2 years ago
scripts Lint staged JS files in pre-commit 1 year ago
stores Keep warns in /unban 5 months ago
utils Create middlewares/logPresence (#104) 5 months ago
.editorconfig Added .editorconfig 1 year ago
.eslintrc.json Update ESLint to get rid of js-yaml exploit 5 months ago
.gitignore Add isMaster util function 1 year ago
Dockerfile Added Dockerfile, Updated readme 2 years ago
LICENSE changed license to AGPL-3.0 2 years ago
README.md Update README with Node 12 requirement 6 months ago
example.config.js Create middlewares/logPresence (#104) 5 months ago
index.js Misc 9 months ago
package-lock.json Bump lodash from 4.17.11 to 4.17.15 1 month ago
package.json Update ESLint to get rid of js-yaml exploit 5 months ago

README.md

The Guard Bot

The Guard is a Telegram bot made to help admins manage their groups.

Initially created to moderate The Devs Network.

NOTE: The Guard is in beta phase; it has known issues, but it’s successfully being used in production

If you need help with using the Bot or setting it up, join our Support Chat.

Setup

You need Node.js (>= 12) to run this bot.

  1. Create a bot via @BotFather and grab a token.
  2. Clone this repository or download zip.
  3. Install dependencies via npm install.
  4. Copy example.config.js to config.js and edit it.
  5. Start the bot via npm start.

Setup with Docker

You need to have docker installed on your machine.

  1. Create a bot via @BotFather and grab a token.
  2. Clone this repository or download zip.
  3. Copy example.config.js to config.js and edit it.
  4. Run docker build -t the_guard_bot . to build image.
  5. Run docker run --rm -itd the_guard_bot to start the bot.

Now you can add the bot as administrator to your groups.

Features

  • Synchronized database across multiple groups.
  • Adding admins to the bot.
  • Auto-remove and warn channels and groups ads.
  • Kick bots added by users.
  • Warn and ban users to control the group.
  • Commands work with replying, mentioning and ID.
  • Removes commands and temporary bot messages.
  • Ability to create custom commands.
  • Supports plugins.

Overall, keeps the groups clean and healthy to use.

Commands

Command Role Available at Description
/admin Master Everywhere Makes the user admin in the bot and groups.
/unadmin Master Everywhere Demotes the user from admin list.
/leave <name\|id> Master Everywhere Make the bot to leave the group cleanly.
/hidegroup Master Groups Revoke invite link and hide the group from /groups list.
/showgroup Master Groups Make the group accessible via /groups list.
/warn <reason> Admin Groups Warns the user.
/unwarn Admin Everywhere Removes the last warn from the user.
/nowarns Admin Everywhere Clears warns for the user.
/ban <reason> Admin Groups Bans the user from groups.
/unban Admin Everywhere Removes the user from ban list.
/user Admin Everywhere Shows the status of the user.
/addcommand <name> Admin In-Bot Create a custom command.
/removecommand <name> Admin In-Bot Remove a custom command.
/staff Everyone Everywhere Shows a list of admins.
/link Everyone Everywhere Shows the current group’s link.
/groups Everyone Everywhere Shows a list of groups which the bot is admin in.
/report Everyone Everywhere Reports the replied-to message to admins.
/commands Everyone In-Bot Shows a list of available commands.
/help | /start Everyone In-Bot How to use the bot.

All commands and actions are synchronized across all of the groups managed by the owner and they work with replying, mentioning or ID of a user.

If used by reply, /ban and /warn would remove the replied-to message.

The bot is still in beta phase so feel free to open issues and ask for features.

Roadmap


Important Note: Under the AGPL-3.0 license, if you’re running your own instance, you should add a link to the source (this repository) in your bot’s bio. If you’re modifying this source and making your own bot, you should link to the source of your own version of the bot according to the AGPL-3.0 license. Check LICENSE for more info.

The Guard icon is from Entypo+ by Daniel Bruce.