A Discord Bot to protect your server from spam, invitations, fake nitro ads and more written in C++

Antispambot

Codacy Badge Lines of code GitHub

An efficient Discord Bot to prevent spam written in C++. Tested on a large discord server and mitigates around 90% spam. Its well commented and can be easily adapt according to your needs.

Features

The following is considered as spam and will be deleted by the bot:

  • discord invitations
  • crossposted messages (repeated messages over too many channels). This also effects fake nitro ads!
  • repeated messages
  • messages with too many mentions
  • bad words (configurable in bad-words.txt)
  • messages that contain blacklisted domains as a url (see domain-blacklist.txt)
  • forbidden file extensions like .exe (configurable)

The bot will time out users who spam!

🤖 It also detects raids when large amounts of users joined in a shorter time.

🕐 All created threads will have a slow-mode of 3 seconds to prevent mass-pings in them.

Supported Platforms

Currently only Linux is supported, but other UNIX-style platforms should build and run the bot fine.

Dependencies

Building

mkdir build
cd build
cmake ..
make -j8

Replace the number after -j with a number suitable for your setup, usually the same as the number of cores on your machine.

Visit the D++ library documentation for more details.

Running

Edit the config.json. The configuration variables in the file should be self-explanatory.

All bad words are saved line by line in the bad-words.txt.

The bypass-config.txt can be used to exclude users and roles from getting detected by the bot, just save the user- and role IDs line by line in it.

All forbidden domains are stored in domain-blacklist.txt. Used to prevent the sharing of certain websites/urls. You can also add top-level-domains to them.

The bot creates discord slash commands to manage the above three .txt-configs, therefor they're stored in extra files.

The bot requires the message content and server members intent to be enabled! Add the bot with the bot and applications.commands scope to your server! The bot needs the following permissions: VIEW_CHANNEL, SEND_MESSAGES, MANAGE_MESSAGES, MANAGE_THREADS, MODERATE_MEMBERS.

I'd recommend running the bot with systemd, to keep the bot always online.

A basic unit file could look like this:

[Unit]
Description=Antispam Discord Bot
After=network.target

[Service]
ExecStart=/home/PATH_TO_THE_EXECUTABLE
Type=simple
Restart=always

[Install]
WantedBy=multi-user.target

Show your support

Be sure to leave a ⭐️ if you like the project and also be sure to contribute, if you're interested! Want to help? Drop me a line or send a PR.

FAQ

Why C++?

I had pretty much the same bot in python, but I had problems with the message cache when it ran on a bigger discord server. Weird things happened and in the end i had no real control of the cache, so i moved to C++.

Owner
Similar Resources

Protect files under a specific folder from deleting or moving by explorer.exe.

Protect files under a specific folder from deleting or moving by explorer.exe.

Explorer-Delete-Protection Protect files under a specific folder from deleting or moving by explorer.exe. Requierments: Microsoft Detours Library - ht

Jan 2, 2022

C/C++ language server supporting multi-million line code base, powered by libclang. Emacs, Vim, VSCode, and others with language server protocol support. Cross references, completion, diagnostics, semantic highlighting and more

Archived cquery is no longer under development. clangd and ccls are both good replacements. cquery cquery is a highly-scalable, low-latency language s

Sep 20, 2022

Bot for the Cee.Studio server

cee-bot Bot for the Cee.Studio server. Getting Started Open config.json and match the cee_bot field to your server primitives Head to listeners/ and f

Sep 12, 2022

A 3-D Printed Bot which can talk, cheer, dance and manage your day-to-day schedule.

cheerup A 3-D Printed Bot which can talk, cheer, dance and manage your day-to-day schedule. In childhood many of us have watched this show "SpongeBob

Sep 5, 2021

Upgraded from Pixar postcard path tracing, instead of printing Pixar, this program print my name, which pose to be more challenging than the original code. The upgraded is also more readable and run 9x faster than the original source code.

Upgraded from Pixar postcard path tracing, instead of printing Pixar, this program print my name, which pose to be more challenging than the original code. The upgraded is also more readable and run 9x faster than the original source code.

SDF-Sphere-Tracing Upgraded from Pixar postcard path tracing, instead of printing Pixar, this program print my name, which pose to be more challenging

Sep 20, 2022

3D scanning is becoming more and more ubiquitous.

Welcome to the MeshLib! 3D scanning is becoming more and more ubiquitous. Robotic automation, self-driving cars and multitude of other industrial, med

Sep 27, 2022

It is a Simple Telegram Bot, which will listen to GitHub Webhook and inform via Telegram

GitHub-Webhook-Bot 🤖 Simple Telegram Bot, which will listen to GitHub Webhook and inform via Telegram Setting Up Config ✍ Go to src/helper.h --- Her

Jun 19, 2022

Optimized, fast and unsafe Uniswap sniping bot for buying new listings.

Optimized, fast and unsafe Uniswap sniping bot for buying new listings.

Optimized, fast and unsafe Uniswap sniping bot for buying new listings. Table of content How does it work? Pregeneration Used libraries Project struct

Sep 29, 2022

Real Time, High performance BOT detection and protection

Real Time, High performance BOT detection and protection

REAL-TIME BOT PROTECTION CHALLENGE IronFox https://innovera.ir IronFox is a real-time and high performance bot protection, that using Nginx as a reve

Jun 5, 2022
Protect your Discord token from malicious grabbers!
Protect your Discord token from malicious grabbers!

Discord Token Protector Protect your Discord token from malicious grabbers! This project is still under development! You might face some unstability i

Sep 26, 2022
OpenScan is an open-source document scanner app that enables users to scan hard copies of documents or notes and convert it into a PDF file. No ads. No data collection. We respect your privacy.
OpenScan is an open-source document scanner app that enables users to scan hard copies of documents or notes and convert it into a PDF file. No ads. No data collection. We respect your privacy.

OpenScan An open source app that enables users to scan hardcopies of documents or notes and convert it to a PDF file. No ads. No data collection. We r

Sep 24, 2022
Classified is an easy and handy encryptor and and decryptor which is can protect your file.

CLASSIFIED Classified is an encrypted and a decrypter. It can encrypt anykind of file with any extension. It is very secure. The thing only matters is

Feb 13, 2022
alie, simplified Discord bot, that's it. As fast and stable as possible.

alie alie, simplified Discord bot, that's it. As fast and stable as possible. Requirements Linux-compatible OS (aka Linux distribution) A C compiler w

Nov 15, 2021
A D++ Discord Bot template for Visual Studio 2019 (x64 and x86)

D++ Windows Bot Template A D++ Discord Bot template for Visual Studio 2019 (x64 and x86, release and debug). The result of this tutorial. This templat

Sep 14, 2022
A Bouncing Seal Discord Bot's Source Code.

A Bouncing Seal It's a fun bot with leveling and funny bouncing seal videos. Information Invite Support Server How to run locally You need DPP, follow

Sep 10, 2021
A fake AMSI Provider which can be used for persistence.
A fake AMSI Provider which can be used for persistence.

A fake AMSI Provider which can be used for persistence.

Sep 27, 2022
Fake bomb for Airsoft
Fake bomb for Airsoft

airsoft-bomb Thanks for your visit in this repo. This project was created around 2015, but it didn't have github, and I always distributed it via emai

Aug 29, 2021
PHP Encoder, protect PHP scripts in PHP 8 and PHP 7, High Performance, Compitable with X86_64, MIPS, ARM platform and Ubuntu/Centos/OpenWRT system.

What's FRICC2? FRICC2 is a PHP Script encryption tool. When you are developing a commercial software using PHP, the script can be distributed as encry

Oct 2, 2022
dex-vm implementation, used to protect the classes.dex file

nmmp 基于dex-vm运行dalvik字节码从而对dex进行保护,增加反编译难度。 项目分为两部分nmm-protect是纯java项目,对dex进行转换,把dex里方法及各种数据转为c结构体,处理apk生成c项目,编译生成so,输出处理后的apk。nmmvm是一个安卓项目,包含dex-vm实现

Sep 30, 2022