Skip to content

Velvox/Velvox-Scam-Prevention-bot.py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Velvox Scam Prevention Bot

Velvox Scam Prevention Bot is a powerful Discord bot designed to protect your server from various threats, including scam links, NSFW servers, and potential malicious executables. It comes with multiple built-in detection features and an easy setup process.

Features

  • Shortened Link Detection: Identifies and flags potentially dangerous shortened URLs.
  • NSFW Server Detection: Automatically detects and flags servers marked as NSFW using a database.
  • Scam Link Detection: Scans for scam links hidden behind legitimate domains (e.g., [steamcommunity.com/redeem](https://scamlink.tdl)).
  • Malicious Executable Detection: Warns users about potentially harmful executables, such as APK, MSI, or PS1 files.
  • Json based Domain blocklists: Warns users when blacklisted domains are sent.
  • And more: Commands to get info about websites, check files etc...

Bot Setup

Without hosting it your self

Invite the bot https://discord.com/oauth2/authorize?client_id=1281627516485767281 and select the server you want the bot to be in!

Hosting the bot your self using Velvox Gamehosting

Warning

I did not have time to modify the setup/install guide so you may run in to simple issues like need to use .env insted of the config.py. When I got some spare time I will modify the guide bellow. If you just want to stay protected with out the selfhosting hasstle just invite the bot via the link above.

1. Download the Bot Package

Download the bot.py, requirements.txt and config.py

2. Upload the Package to Velvox Gamehosting

  • Purchase your Discord bot with the "Python Generic" option.
  • Go to the game panel, navigate to "your server" > Files, and upload the files into the /home/container/ directory.
  • Create a database in the "Database" tab and save the login details.

3. Configure the Bot

  • Open the config.py file and configure the MySQL connection in the # MySQL configuration function by entering the correct login credentials:

    # MySQL Database Configuration
    MYSQL_HOST = "yourdatabasehost"
    MYSQL_USER = "yourdatabaseuser"
    MYSQL_PASSWORD = "yourdatabasepassword"
    MYSQL_DATABASE = "yourdatabasename"
  • Add your Discord bot token at the BOT_TOKEN line, which can be obtained from the Discord Developer Portal.

    # Bot configuration
    BOT_TOKEN = 'yourbottoken'
  • Ensure the MySQL database has the necessary tables. Create them with the following SQL statement:

    -- Table to store users who opted-in for DM warnings
    CREATE TABLE IF NOT EXISTS dm_user_permissions (
        user_id BIGINT PRIMARY KEY,
        status TINYINT(1) NOT NULL DEFAULT 1
    );
    
    -- Table to store scam signatures
    CREATE TABLE IF NOT EXISTS scam_signatures (
        id INT AUTO_INCREMENT PRIMARY KEY,
        signature VARCHAR(255) NOT NULL
    );
    
    -- Table to store flagged NSFW or malicious servers
    CREATE TABLE IF NOT EXISTS nsfw_scam_servers (
        id INT AUTO_INCREMENT PRIMARY KEY,
        guild_id BIGINT NOT NULL UNIQUE,
        reason TEXT NOT NULL
    );
    
    -- Table to store reports (for servers and bots)
    CREATE TABLE IF NOT EXISTS reports (
        id INT AUTO_INCREMENT PRIMARY KEY,
        report_type ENUM('server', 'bot') NOT NULL,
        reported_id BIGINT NOT NULL,
        already_reported TINYINT(1) DEFAULT 0
    );

4. Install Required Packages

The game panel should automatically install all necessary packages. If you encounter errors, reach out to Velvox support.

5. Run the Bot

After configuration, click "Start" in the game panel. Ensure your bot has the correct permissions set in the Discord Developer Portal. You can now start using the bot in your Discord server!

For more detailed usage, refer to the commands section.

Commands

Velvox Scam Prevention Bot supports Discord Slash Commands. Here are the available commands:

Scam Prevention

Important Commands

  • /allowdmwarning: Toggle DM warning status for yourself. Adds or removes you from the list of users who receive DM warnings about potential scams.
  • /whatisascam: Provides an explanation of what constitutes a scam, including common types and warning signs.

Standard Commands

  • /vtdcheck: Checks a domain or URL for malicious activity using VirusTotal. Provides a summary of the findings and a link to VirusTotal for detailed information.
  • /checkfile: Gets the hash(SHA256) and link to threat inteligence sources for more information about the potential malicious files.

Reporting

Important Commands

  • /report: Initiates a report process. Includes options for reporting servers (/reportserver) or bots (/reportbot). Checks if the target is already reported and updates the report status accordingly.

Standard Commands

  • /reportserver: Report a server for suspicious or malicious activity. Updates the database with the report details.
  • /reportbot: Report a bot for suspicious or malicious activity. Updates the database with the report details.

Other

  • /botinfo: Gives information about the bot.
  • /domaincheck: Check an domain on multiple sources on its security practices.
  • /messagedelete: (ADMIN ONLY) Disables/enables the message deletion function on malicouis messages.

How to check if an server invite is malicious?

  • Just send the link to the bot if it is flagged it will respond whith an embed. If no reply is send this indicates that we did not get reports from this server. THIS DOES NOT MEAN THAT IT IS AN SAFE ONE. Always proceed with caution!

Known issues

  • The bot may send multiple replies to an server link that is flagged in our database. This may be fixed in the future.

License

This bot is licensed under the GNU General Public License v3.0. See the LICENSE file for more details.

About

A discord bot that alerts on possible scam's in discord servers written in python

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Languages