Giter Site home page Giter Site logo

ai-anti-bot's Introduction

ai-anti-bot

Anti-spam robot for Telegram groups

English | 简体中文

license MIT Go version 1.22.3 telebot v3

Telegram is a world-renowned, very convenient and elegant anonymous communication tool.
However, due to the anonymity of the software, a lot of spam promotion information often appears in the group. We have no way to identify whether there is spam information in the group at all times.
Fortunately, Telegram provides us with a very powerful Api. Now we can use artificial intelligence to automatically help us detect user behavior.

If you are a group administrator of Telegram, you can directly deploy this project privately.

If you are a developer, you can use this project to familiarize yourself with the interactive development of Go language and Telegram, so that you can use Api to develop your own robot later!

References:

How to use

Docker Compose

# Clone the project
git clone https://github.com/assimon/ai-anti-bot.git && cd ai-anti-bot && mkdir data

# Set up your configuration
cp config.yml.example data/config.yml

# Fill in the configuration according to your needs
vi config.yml

# start up
docker compose up -d

It's very simple, right?😄

How to configure

telegram:
  proxy:
  token: ""     # Fill in your robot token
  groups: [""]  # Fill in the group id where the robot needs to take effect
  owners: [""]  # Fill in the super administrator's telegram user ID
identification_model: "chatgpt"

# The following is the judgment strategy. For example, 
# the meaning of the following configuration item is: If you have joined the group for more than 3 days and have spoken more than 3 times or have been verified once, you do not need to verify again.
# This is to save your tokens😊
strategy:
  joined_time: 3
  number_of_speeches: 3
  verification_times: 1
  
chatgpt:
  proxy: ""   # OpenAI's proxy address, if necessary
  apikey: ""  # apikey
  model: "gpt-4o-mini"   # The detection model to be used. Please note that versions below gpt4 do not support image and file interaction.

# If your native language is not Chinese but other languages, 
# please use the translation to replace the following prompt with the language you want.
prompt:
   ...

Other commands

/start       # Survival detection: feedback will be given if the robot service is running normally

# We can also use the following command to add our own advertising button to the robot, but please be sure to configure the telegram.owners option

/add_ad     # /add_ad #Add a new ad, format: ad title|jump link|expiration time (with hours, minutes, seconds)|weight (in descending order, the larger the value, the higher the weight), for example: /add_ad Hello|https://google.com|2099-01-01 00:00:00|100

/all_ad     # View All Ads Button

/del_ad     # Delete an ad button, for example: /del_ad 1 (delete the ad with id 1)

Preview

preview.png

ai-anti-bot's People

Contributors

assimon 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.