Git Product home page Git Product logo

silencebot's Introduction

Silence Bot for Telegram supergroups

Silence Bot allows you to calm down all chat participants by muting them temporarily.

Just add the bot to your supergroup, give it message deletion and user restriction rights and you're all set. If you give it a right to pin messages, the bot will pin "Silence mod enabled" messages.

Use /silence to enable silent mode.

All non-admin messages will be deleted in silent mode, any user who tries to send a message will get a temporary read-only restriction.

Use /silence again to disable silent mode.

All users will be unrestricted automatically and be able to chat.

Use /switchlang to switch between Russian and English

Please note that the bot requires running Redis instance to store data.

I'm very new to Go, so I'll be happy if you make some pull requests.

Building for all platforms

Make sure you have Go installed and just run

./build.sh

Building manually

Install dependencies

go get ./...

And then build

CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -tags netgo -ldflags '-s -w -extldflags "-static"' -o silencebot

Running

Use ./silencebot -t <YOUR_TELEGRAM_TOKEN> to start the bot.

By default it connects to localhost:6379 Redis instance without password and selects db 0. You can customize this behavior, check ./silencebot -h for all arguments.

Running as a background service

There are two ways as for now: Docker compose and systemd service

Don't forget to replace token!

Docker compose is ready to use, but not recommended for stable environments as long as redis is running inside Docker.

systemd service example (recommended)

TODO

  • Embedded service autoinstall
  • Minimal hidden admin commands (/stats, /health, /uptime etc.)

silencebot's People

Contributors

aprosvetova avatar kirilldanshin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.