Code Monkey home page Code Monkey logo

telegram-community-bot's Introduction

FirmaChain Official Telegram Group Bot

firmachain official bot


Overview

This project implements a bot for managing the 'FirmaChain Global Official' Telegram group.


Features

The bot immediately kicks out any new bots that join the chat room, temporarily restricts all rights of new users, and sends a message button for restoring these rights. Users have to click the button within 3 minutes, otherwise the message will be automatically deleted. When the button is clicked, a welcome message is sent to the user, and each time a new user clicks the button, the most recent welcome message is deleted and a new welcome message is sent.

This project uses a separate scheduler process. The scheduler automatically deletes the message 3 minutes later if the user does not click the button to restore rights.


Environment Setup

To set up the environment, you first need to copy the .env.sample file to .env.production and set appropriate values for each environment variable.

# File copy
$ cp .env.sample .env.production
  • PORT: Specifies the port on which the server will run (e.g. 3000).

  • TOKEN: Specifies the token value of the bot.

  • GROUP_CHAT_ID: Specifies the ID of the Telegram group chat to be managed.

  • RESTRICT_DELETE_TIME: Specifies the time in minutes to delete the message after setting the restriction (e.g. 3).

  • RESTRICT_FILE_PATH: Specifies the path of the file where the restriction message is stored (e.g. public/your_restrict_filename.json).

  • NOTICE_FILE_PATH: Specifies the path of the file where the notice message is stored (e.g. public/your_notice_filename.json).


Build Method

# Clone repository
$ git clone https://github.com/FirmaChain/telegram-community-bot.git

# Move to project folder
$ cd telegram-community-bot

# Install necessary packages
$ npm install

# Copy .env.sample file to .env.production
$ cp .env.sample .env.production

# Run server
$ npm run start

In the state where the server is running, the scheduler must be run separately. The scheduler is set to run every minute.

# Run scheduler
$ npm run start:scheduler

telegram-community-bot's People

Contributors

thismars avatar

Stargazers

Unagi avatar  avatar kimminki avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar u2dao avatar LarryKim avatar  avatar  avatar chill_beer avatar Donghoon Kim avatar

Watchers

James Cloos avatar Donghoon Kim avatar  avatar kimminki avatar  avatar LarryKim avatar  avatar chill_beer avatar  avatar  avatar  avatar u2dao avatar  avatar  avatar InfinityStake avatar  avatar  avatar  avatar

Forkers

annihilatorrrr

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.