This bot is a cool Discord bot made in discord.js using Node.JS

Overview

Anti-Crosspost Discord Bot


This bot is a cool Discord bot made in discord.js using Node.JS. It detects when a user cross-posts a message in multiple channels in a Discord server, and automatically deletes it. It even works if the strings are grammatically different, and similar in meaning, but not same, and even if they have different punctuation! It only affects messages with a character length 15 or above, but this can be changed in the index.js file. It also does not affect messages sent more than 10 minutes ago

This bot is mostly meant for Support Servers and Development-help servers where people cross-post messages that they need help with.

Example:

Gif showing the bot

NOTE: This bot is meant to be a single-server bot. It WILL BREAK IF YOU TRY TO RUN IT ON MULTIPLE SERVERS! You will have to adjust the code yourself to make it usable in multiple servers correctly!


Requirements

This bot hardly has any requirements. All you need is:

  • A discord bot on the Discord developer page
  • A host capable of running a Discord bot
  • Node.JS v16.6 minimum
  • Slight know-how of Javascript, if you want to do some basic configuration like whitelisting roles/channels
  • Dev-mode on in Discord, for some basic configuration like whitelisting roles/channels
  • A text editor or an IDE

Setting it up

Setting this bot up is super simple! First of all, fire up your terminal and type in npm i and wait for the libraries to install. Then, copy the token from Discord developer page and on line 15 of index.js, paste the token between the brackets and "", like this:

client.login("GAC3MTM4NDg2NjIwNTIwNDQ4.GBHacd.y1GHAC-86Dn4QVChovI8o2U-iBR"); //this token here doesnt really work

Then in your terminal, type in node index.js, and viola, its up and running!

NOTE: i did not add any error handling since this bot is not meant to be a multi-server bot, and other servers will have to give this bot ADMINISTRATOR permissions for smoothest experience so that it does not crash. If you do not, and it is unable to delete the message or send back a message, it will crash! You can add the error handling yourself if you want


FAQ

How do I stop the bot from affecting moderators/certain people

Ans: Simple! Just copy the role IDs, and on line 6, you can add them into the array given(Dev-mode enabled is a requirement).
Example:

const rolesNotToCheck = ["123456789012345678","8383939293883288283"];

How do I whitelist certain channels from being affected by this bot?

Ans: Easy! Copy the channel IDs, and on line 5, you can add them into the array (Dev-mode enabled is a requirement).
Example:

const channelsNotToCheck = ["123456789012345678","8383939293883288283"];

How can we make it such, that it affects older messages too, say sent around 30 minutes ago?

Ans: Super easy! Go to line 19, and set timeToRemoveValue accordingly (in milliseconds). 10*60000 means 10 minutes but in milliseconds, but for 30 minutes, you can change it to 30*60000, and thats it!

The bot is not affecting similar messages in cross-posts/Why is the bot affecting non-similar messages?

Ans: Even though this bot is coded using the best available algorithms, it is not Artificial Intelligence, so it sometimes does not work on all cross-posts, and sometimes even has false positives. The ratio that I have set it to is 0.7, which was the sweet spot to neither affect many different messages, and to affect similar messages, even though its not perfect. On line 60, try messing around with the 0.7 value (The maximum it can be is 1).
NOTE: Lower means there is a more chance of false positives, and higher means it will sometimes not affect similar messages

How to change minimum message length for the bot to affect?

Ans: On line 44, remove || message.content.length < 15 if you want to check all types of messages for cross-posts or change 15 to a smaller value if you want to reduce the minimum message length value

NOTE: After every change in index.js file, you will need to restart the bot or it will not load the new configuration!


Easy peasy, lemon squeezy

Credits to:

  • Joakim#9814 for giving me the idea for it

And more coming soon...

You might also like...

Gitlift Discord Bot is a discord bot which is listening Discord Messages to reply with user gitlift profile and total contributions.

Gitlift Discord Bot is a discord bot which is listening Discord Messages to reply with user gitlift profile and total contributions.

Remoklify - Gitlift Discord Bot Gitlift Discord Bot is a discord bot which is listening Discord Messages to reply with user gitlift profile and total

Mar 20, 2022

This is discord bot specifically made for Community Classroom

This is discord bot specifically made for Community Classroom

Classroom Monitor Bot This bot provides functionalities for 'Community Classroom' discord server. Community Classroom is an initiative 'for the studen

Apr 10, 2022

A simple Facebook Messenger Bot like Discord Was Made By Me(CatalizCS) And My Brother SpermLord

A simple Facebook Messenger Bot like Discord Was Made By Me(CatalizCS) And My Brother SpermLord

MiraiBot A simple Facebook Messenger Bot made by me(CatalizCS) and my brother SpermLord. Report Bug · Request Feature Table of Contents Giới thiệu Hướ

Jan 2, 2023

An advanced discord bot made on Javascript with ❤ by FlyAbove

Discord JavaScript Bot An advanced discord bot made on Javascript with ❤ by FlyAbove Setup guide: Clone the repository and change config-example.json

Apr 13, 2022

Discord bot made in javascript to play youtube music.

DJS O DJS é um bot para Discord com a capacidade da criar playlists personalizadas, tendo como fonte a biblioteca de músicas do Youtube. Frameworks e

Aug 21, 2022

This bot is made on latest discord.js V 13

discord.js-v13-bot This bot is made on latest discord.js V 13 THIS BOT IS MADE BY DAMON VISIT HIS SERVER HERE = https://discord.gg/djrPQaczPw THIS BOT

May 11, 2022

A Discord Music Bot made with ♥ by Ahad#3257

A Discord Music Bot made with ♥ by Ahad#3257

Discord-Music-Bot A Discord Music Bot made with ♥ by Ahad#3257 How To Use? It's very simple just follow the steps written below. Run setup.bat to inst

Oct 25, 2022

Denky is a multipurpose Discord bot, build with Node.js, TypeScript and discord.js.

🤖 Denky Bot Denky is a brazilian Discord bot, build with Node.js, TypeScript and discord.js. ⚙️ How to Create a Discord application. Guide Install No

Apr 6, 2022

Denky is a multipurpose Discord bot used in +3000 servers. Built with Node.js, TypeScript and discord.js.

🤖 Denky Bot Denky is a brazilian Discord bot, built with Node.js, TypeScript and discord.js. ⚙️ Self hosting ⚠️ Support will not be provided for self

Dec 26, 2022
Owner
Muhammad Usman Mithani
I can make professional websites and am really experienced in Javascript related stuff. I am currently making a Discord bot, Meembot. Invite https://dsc.gg/meem
Muhammad Usman Mithani
A multipurpose bot, a clan bot, a all in one bot. The one bot u need for ur server originally made as Milrato discord Bot and by Tomato6966.

Public Bot and Support Server! Invite the Public Version of this Bot so you don't need to host it by yourself or join my Discord server to get a custo

Tomato6966 472 Dec 25, 2022
A discord bot made using discord.js and discord-player

Musx A custom discord bot that can play music in your server ?? Add the bot to your server If you are looking for a music bot for your Discord server

Shashwat Singh 4 Mar 28, 2022
About Discord bot draft that does not contain ready-made commands, compatible with discord.js v14. Create your own discord bot with this command handler.

discordJS-V14 About Discord bot draft that does not contain ready-made commands, compatible with discord.js v14. Create your own discord bot with this

Umut Bayraktar 36 Dec 28, 2022
Discord-Bot - You can use the discord bot codes that are updated in every video of the codes I use in the discord bot making series that I have published on my youtube channel.

Discord-Bot You can use the discord bot codes that are updated in every video of the codes I use in the discord bot making series that I have publishe

Umut Bayraktar 114 Jan 3, 2023
A discord chatbot made using discord.js

Discord Chatbot A discord chatbot made with Discord.js and Mongoose. ?? Installation and usage Install Node.js v16.9.0 or higher. Download and unzip t

null 16 Jan 1, 2023
Cyrus is a Discord Bot with focus on Fun, Moderation, information and much more commands! Made it with Discord.js

Cyrus Cyrus is a Discord Bot with focus on Fun, Moderation, information and much more commands! Made it with Discord.js Invite : Click here Vote : Top

null 4 Dec 3, 2022
A Discord bot project made with the npm package discord.js version 14

A Discord bot project made with the npm package discord.js version 14 and it's job to manage mails on a server, and this project includes only one Database: Quick.db. This project also handles Slash commands.

T.F.A 33 Jan 6, 2023
A Simple Music Bot Made Using Discord-Player Package - (Beta)

Our Music Bot A Highly Powerful Music Bot Without Lavalink Which Is Gonna Have Setup, A Specific Text Channel For Bot Command Feature, And DJ System S

null 12 Dec 14, 2022
The official bot for Lewis Menelaws (TectTok). The bot is made by using Typescript. Feel free to contribute!

lewis-bot Prerequisites Create an application in Discord's developer portal. You need to add all the Intents and permissions. Then create a link in OA

Luka Hietala 2 Aug 11, 2022