A discord bot that can detect Nitro Scam Links and delete them to protect other users

Overview

Detetective Discord

๐Ÿ’ก Inspiration

Have you ever recieved a message like this?

If you have been on Discord for a while, I am sure you have been warned to stay away from these links.
But what about the newbies that are just starting out?
One of such incidents happend this thursday on my server. A bunch of people fell victim to such phishing links.
There was no such bots available in the market to solve this problem so I decided to make it on my own.

๐Ÿ’ป What it does

Detective Discord is a bot that detects phishing links in Discord messages, deletes them, warns the user who sent them and increase thier warning count by 1. Once the warning count reaches 3, the user is banned from the server.
In case of a ban, the user is also informed by the bot for the same.

This bot can also perform a few other actions like:

  • $news - Get latest news from BBC
  • $weather - Get weather in a city
  • $joke - Get a random joke
  • $wiki - Get a summary of a search key from Wikipedia
  • $help - Get this message
  • $reset_warn - Reset warnings for a user (admin/moderator only)

โš™๏ธ How I built it

The rules to detect phishing links are simple:

  • Check if the message contains a link.
  • Check if the link is not exactly the same as the real discord links like discord.gg or discord.me.
  • Calculate the Levenstien Distance between the link and the real discord links.
  • If the distance is less than 4, or the message contains words like discord or nitro, the link is considered to be phishing link.

For fetching the News, the bot uses the BBC API.
For fetching the weather, the bot uses the OpenWeatherMap API.
For fetching the jokes, the bot uses the pyjokes python library.
For fetching the Wikipedia summary, the bot uses the Wikipedia python library.

โš™๏ธ Tech Stack

Python Discord SQLite Wikipedia

๐Ÿง  Challenges we ran into

At first, I thought it would be a really simple task but as I started to build it, I realized it wasn't that easy after all.
Firstly I had to make the rules to identify phishing links. But I also had to make sure that the bot would not delete the links that are not phishing links.
After hovering over various methods, I settled on using the Levenstien Distance algorithm.
After that, when testing the bot I realized that the bot would also delete the links that were not phishing links but other discord links.
So I had to tweak the rules and make them inclusive to the other links.
Finally, I had a hard time deleting the user from the database who sent the phishing links. There was a bug that I wasn't able to detect and it took me 1 whole hour to fix it.

๐Ÿ… Accomplishments that we're proud of

I am proud of the fact that I was able to build this bot in a day and that now my Server will no longer suffer from these phishing scams.

๐Ÿ“– What we learned

This is the first time I have build a discord bot. I learnd how to use the discord.py library and how to use the discord.py API.

๐Ÿš€ What's next for Detetective Discord

Setting a workflow to save the phishing links in the database and at the stroke of the midnight, report them through the appropriate channels.

You might also like...
Discord Mass Edit is a unique, purging related Discord tool that differs from the regular mass delete.

Discord Mass Edit is a unique, purging related Discord tool that differs from the regular mass delete. This tool will automatically edit every message in a chosen channel and change it to a random string.

this repo store a Awoesome telegram bot for protect from your large group from bot attack.

this repo store a Awoesome telegram bot for protect from your large group from bot attack.

A Discord bot to combat phishing links for Steam trades and Discord gifts.

delink-bot A Discord bot to combat phishing links for Steam trades and Discord gifts. Requirement python3 -m pip install -U discord.py python3 -m pip

A discord nuking tool made by python, this also has nuke accounts, inbuilt Selfbot, Massreport, Token Grabber, Nitro Sniper and ALOT more!
A discord nuking tool made by python, this also has nuke accounts, inbuilt Selfbot, Massreport, Token Grabber, Nitro Sniper and ALOT more!

Disclaimer: Rage Multi Tool was made for Educational Purposes This project was created only for good purposes and personal use. By using Rage, you agr

File-sharing-Bot: Telegram Bot to store Posts and Documents and it can Access by Special Links.

File-sharing-Bot Telegram Bot to store Posts and Documents and it can Access by Special Links. I Guess This Will Be Usefull For Many People..... ๐Ÿ˜‡ .

๐ŸฆŠ Powerfull Discord Nitro Generator
๐ŸฆŠ Powerfull Discord Nitro Generator

๐ŸฆŠ Follow me here ๐ŸฆŠ Discord | YouTube | Github โ˜• Usage ๐Ÿ’ป Downloading git clone https://github.com/KanekiWeb/Nitro-Generator/new/main pip insta

My attempt to reverse the Discord nitro token generation function.
My attempt to reverse the Discord nitro token generation function.

discord-theory-I PART: I My attempt to reverse the Discord nitro token generation function. The Nitro generation tools thing is common in Discord now,

PepeSniper is an open-source Discord Nitro auto claimer/redeemer made in python.

PepeSniper is an open-source Discord Nitro auto claimer made in python. It sure as hell is not the fastest sniper out there but it gets the job done in a timely and stable manner. It also supports hosting on heroku for 24/7 sniping without your PC

A discord nitro generator written in python

VerseGenerator A discord nitro generator written in python Usage ใƒปFork the repo ใƒปClone it to replit ใƒปInstall the required packages and run it ใƒปInput t

Comments
  • Reference `.env` file instead of hardcoding Key values in code.

    Reference `.env` file instead of hardcoding Key values in code.

    https://github.com/kanakmi/Detective-Discord/blob/8b8118f8476d2052d973e88bc104c0a8f4b19300/bot.py#L12

    I suggest we should load these values form .env file which is the usual method, and a security measure, and not put senstive information in code.

    opened by shivanshu-semwal 1
Owner
Kanak Mittal
Data Scientist | B.Tech CSE Candidate | Competitive Coder | 6* @ Hackerrank (Problem Solving)
Kanak Mittal
Download nitro generator that generates free nitro code that you can use for Discord

Download nitro generator that generates free nitro code that you can use for Discord, run it and wait for free nitro to come

Umut Bayraktar 154 Jan 5, 2023
A discord Server Bot made with Python, This bot helps people feel better by inspiring them with motivational quotes or by responding with a great message, also the users of the server can create custom messages by telling the bot with Commands.

A discord Server Bot made with Python, This bot helps people feel better by inspiring them with motivational quotes or by responding with a great message, also the users of the server can create custom messages by telling the bot with Commands.

Aran 1 Oct 13, 2021
just a program i made cuz a friend got tokenlogged and spammed me with these scam/phishing links so i made a programm to spam these websides with fake logins

scam-webside-spammer just a program i made cuz a friend got tokenlogged and spammed me with these scam/phishing links so i made a programm to spam the

TerrificTable 3 Sep 23, 2022
One version package to rule them all, One version package to find them, One version package to bring them all, and in the darkness bind them.

AwesomeVersion One version package to rule them all, One version package to find them, One version package to bring them all, and in the darkness bind

Joakim Sรธrensen 39 Dec 31, 2022
Generate discord nitro codes and check them

Discord Nitro Generator and Checker A discord nitro generator and checker for all your nitro needs Explore the docs ยป Report Bug ยท Request Feature ยท J

null 509 Jan 2, 2023
S3-cleaner - A Python script attempts to delete the all objects/delete markers/versions from specific S3 bucket

Remove All Objects From S3 Bucket This Python script attempts to delete the all

null 9 Jan 27, 2022
This is new discord nitro generator for discord

Hello! This is new discord nitro generator for discord. If you want use it, To generator i added checker for no seraching generator and checker. This tool maked by .

ItzBolt 1 Jan 16, 2022
Linky bot, A open-source discord bot that allows you to add links to ur website, youtube url, etc for the people all around discord to see!

LinkyBot Linky bot, An open-source discord bot that allows you to add links to ur website, youtube url, etc for the people all around discord to see!

AlexyDaCoder 1 Sep 20, 2022
SongLink Discord Bot - Discord bot to share music links easily

SongLink_Discord_Bot Discord bot to share music links easily. Take a link from y

Edgar Lefevre 4 Feb 18, 2022
discord token grabber scam - eductional purposes only!

Discord-QR-Scam ืชื•ืคืก ืืกื™ืžื•ืŸ ืชืžื•ื ื” ืฉืœ Discord ืขืœ ืื•ื“ื•ืช ืกืงืจื™ืคื˜ Python ืฉื™ื•ืฆืจ ืื•ื˜ื•ืžื˜ื™ืช ืงื•ื“ QR ื”ื•ื ืื” ืฉืœ Nitro ื•ืชื•ืคืก ืืช ืืกื™ืžื•ืŸ ื”ื“ื™ืกืงื•ืจื“ ื‘ืขืช ืกืจื™ืงื”. ื›ืœื™ ื–ื” ืžื“

Amit Pinchasi 0 May 22, 2022