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.

Owner
Kanak Mittal
Data Scientist | B.Tech CSE Candidate | Competitive Coder | 6* @ Hackerrank (Problem Solving)
Kanak Mittal
If you are in allot of groups or channel and you would like to leave them at once use this

Telegram-auto-leave-groups If you are in allot of groups or channel and you would like to leave them at once use this USER GUIDE πŸ‘£ Insert your telegr

Julius Njoroge 4 Jan 03, 2023
Discord Token Generator of a project - Some stupids ppl are trying to leak it so i'm leaking faster :)

Original creator: Rolf (dort) HCaptcha Bypasser: h0nde Shark.Solar Discord Token Generator of a project - Some stupids ppl are trying to leak it so i'

Stanley 14 Sep 29, 2021
A quick and dirty script to scan the network, find default credentials on services and post a message to a Slack channel with the results.

A quick and dirty script to scan the network, find default credentials on services and post a message to a Slack channel with the results.

Security Weekly 11 Jun 03, 2022
An API Client package to access the APIs for NBA.com

nba_api An API Client package to access the APIs for NBA.com Development Version: v1.1.9 nba_api is an API Client for www.nba.com. This package is mea

Swar Patel 1.4k Jan 01, 2023
a Disqus alternative

Isso – a commenting server similar to Disqus Isso – Ich schrei sonst – is a lightweight commenting server written in Python and JavaScript. It aims to

Martin Zimmermann 4.7k Jan 02, 2023
Jalali version of python calendar :date:

jcalendar jcalendar is Jalali implementation of Python's calendar module Status Install pip install jcalendar Documents This module almost follows Py

Iman Kermani 7 Aug 09, 2022
Track player's stats, find out when they're online and grinding!

Hypixel Stats Tracker Track player's stats, find out when they're online and playing games! INFO Showcase Server: https://discord.gg/yY5qQHPar6 Suppor

4 Dec 18, 2022
A GitHub Follower Bot that is a WIP.

GitHub Follower Bot (WIP) Work In Progress This bot is a WIP. There are still many features I plan to add and code I need to improve (I'm still fairly

Christian Deacon 71 Dec 29, 2022
Based Telegram Bot and Userbot To Play Music in Your Telegram Groups With Some Cool Extra Features! πŸ₯°

CallMusicPlus69 This Repo base on! πŸ€—οΈ A CallsMusic Based Telegram Bot and Userbot To Play Music in Your Telegram Groups With Some Cool Extra Features

brut✘⁢⁹ // ユスフ 6 Jun 26, 2022
SimpleDCABot is a simple bot that buys crypto with a dollar-cost averaging strategy.

Simple Open Dollar Cost Averaging (DCA) Bot SimpleDCABot is a simple bot that buys crypto on a selected exchange at regular intervals for a prescribed

4 Mar 28, 2022
A robust, low-level connector for the Discord API

Bauxite Bauxite is a robust, low-level connector for the Discord API. What is Bauxite for? Bauxite is made for two main purposes: Creating higher-leve

1 Dec 04, 2021
RedFish API Toolkit

RedFish API Toolkit RedFish API Toolkit Build Status GitHub Actions Travis CI Requirements requirements.txt requirements-dev.txt Dependencies Document

Larry Smith Jr. 1 Nov 20, 2021
Widevine MPD Content Downloader & Decryptor

Widevine-DL Encrypted MPD Manifest Content Downloader + Decryptor (not a Widevine Key Extractor!) Requirements ffmpeg, yt-dlp, aria2, widevine-l3-decr

Vank0n (SJJeon) 170 Dec 30, 2022
Find the best repos to contribute to, right from Discord!

repo-finder-bot Find the best repos to contribute to, right from Discord! Add to your server FAQs Hmm. What's this? This is the Repo Finder Bot, a bot

Skyascii 61 Dec 25, 2022
Python binding for Microsoft LightGBM

pyLightGBM: python binding for Microsoft LightGBM Features: Regression, Classification (binary, multi class) Feature importance (clf.feature_importanc

Ardalan 330 Nov 18, 2022
A simple Python API wrapper for Cloudflare Stream's API.

python-cloudflare-stream A basic Python API wrapper for working with Cloudflare Stream. Arbington.com started off using Cloudflare Stream. We used the

Arbington 3 Sep 08, 2022
A Python library for the Discourse API

pydiscourse A Python library for working with Discourse. This is a fork of the original Tindie version. It was forked to include fixes, additional fun

Ben Lopatin 72 Oct 14, 2022
Yes, it's true :revolving_hearts: This repository has 301 stars.

Yes, it's true! Inspired by a similar repository from @RealPeha, but implemented using a webhook on AWS Lambda and API Gateway, so it's serv

510 Dec 28, 2022
Example notebooks for working with SageMaker Studio Lab. Sign up for an account at the link below!

SageMaker Studio Lab Sample Notebooks Available today in public preview. If you are looking for a no-cost compute environment to run Jupyter notebooks

Amazon Web Services 304 Jan 01, 2023
MSE5050/7050 Materials Informatics course at the University of Utah

MaterialsInformatics MSE5050/7050 Materials Informatics course at the University of Utah This github repo contains coursework content such as class sl

41 Dec 30, 2022