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
This is a translator that i made by myself in python with the 'googletrans' library

Translator-Python This is a translator that i made by myself in python with the 'googletrans' library This application completely made in python allow

Thadeuks 2 Jun 17, 2022
Pincer-ext-commands - A simple, lightweight package for pincer prefixed commands

pincer.ext.commands A reimagining of pincer's command system and bot system. Ins

Vincent 2 Jan 11, 2022
Stream Telegram files to web

Telegram File Stream Bot A Telegram bot to stream files to web Demo Bot » Report a Bug | Request Feature Table of Contents About this Bot Original Rep

Wrench 572 Jan 09, 2023
A discord tool to use bugs and exploits

DiscordTool A discord tool to use bugs and exploits Features: send a buggy messa

6 Aug 19, 2022
Implementation of Chatterbot using Discord API

discord-chat-bot Implementation of Chatterbot using Discord API. Usage Due to the necessity of storing files to train the AI, the bot is not hosted pu

kiwijuice56 0 Sep 29, 2022
ShadowMusic - A Telegram Music Bot with proper functions written in Python with Pyrogram and Py-Tgcalls.

⭐️ Shadow Music ⭐️ A Telegram Music Bot written in Python using Pyrogram and Py-Tgcalls Ready to use method A Support Group, Updates Channel and ready

TeamShadow 8 Aug 17, 2022
A modular Telegram group management bot running with Python based on Pyrogram.

A modular Telegram group management bot running with Python based on Pyrogram.

Jefanya Efandchris 1 Nov 14, 2022
AKShare is an elegant and simple financial data interface library for Python, built for human beings

AKShare is an elegant and simple financial data interface library for Python, built for human beings

AKFamily 5.8k Dec 30, 2022
Open Source Discord bot with many cool features like Weather, Balance, Avatar, User, Server, RP-commands, Gif search, YouTube search, VK post search etc.

Сокобот Дискорд бот с открытым исходным кодом. Содержит в себе экономику, полезные команды (!аватар, !юзер, !сервер и тд.), рп-команды (!обнять, !глад

serverok 2 Jan 16, 2022
Sakura: an powerfull Autofilter bot that can be used in your groups

Sakura AutoFilter This Bot May Look Like Mwk_AutofilterBot And Its Because I Like Its UI, That's All Sakura is an powerfull Autofilter bot that can be

PaulWalker 12 Oct 21, 2022
A command line interface for accessing google drive

Drive Cli Get the ability to access Google Drive without leaving your terminal. Inspiration Google Drive has become a vital part of our day to day lif

Chirag Shetty 538 Dec 12, 2022
Discord raiding tool. Made in python 3.9

XSpammer Discord raiding tool with 20 features. YT Showcase Requirements/Installation Python 3.7+ [https://python.org] Run setup.bat to install the es

Tiie 6 Oct 24, 2022
A discord bot that send SMS spam!

bruh-bot send spam sms! send spam with email! it sends you spam via sms and Email using two tools, quack and impulse! if you have some problem contact

pai 32 Dec 25, 2022
Pycardano - A lightweight Cardano client in Python

PyCardano PyCardano is a standalone Cardano client written in Python. The librar

151 Dec 31, 2022
Telegram Userbot to steram youtube live or Youtube vido in telegram vc by help of pytgcalls

TGVCVidioPlayerUB Telegram Userbot to steram youtube live or youtube vidio in telegram vc by help of pytgcalls Commands = Vidio Playing 🎧 stream :

Achu biju 3 Oct 28, 2022
Bot interpretation of the carbon.now.sh site

📒 Source code of the @PicodeBot 🧸 Developer: @hoosnick Run $ git clone https://github.com/hoosnick/picodebot.git $ pip install -r requirements.txt P

Husniddin Murodov 13 Oct 02, 2022
buys ethereum based on graphics card moving average price on ebay

ebay_trades buys ethereum based on graphics card moving average price on ebay Built as a meme, this application will scrape the first 3 pages of ebay

ConnorCreate 41 Jan 05, 2023
Karen is a Discord Bot that will check for a list of forbidden words/expressions, removing the message that contains them and replying with another message.

Karen is a Discord Bot that will check for a list of forbidden words/expressions, removing the message that contains them and replying with another message. Everything is highly customizable.

Rafael Almeida 1 Nov 03, 2021
A Python module for communicating with the Twilio API and generating TwiML.

twilio-python The default branch name for this repository has been changed to main as of 07/27/2020. Documentation The documentation for the Twilio AP

Twilio 1.6k Jan 05, 2023
Telegram Auto Filter Bot

Pro Auto Filter Bot V2.o Hey Mo Tech, I'm an Autofilter bot v2.O and you can not Add Me to your Group. I was made for this one group. So don't waste y

14 Oct 20, 2021