Giter VIP home page Giter VIP logo

postman-sentinel's Introduction

Postman Sentinel

This is the main repository of the Postman Sentinel Discord Bot.

About :

Postman Sentinel is a Discord Bot developed by Çetin Kaan Taşkıngenç & Claire Froelich. It's main aims are to help make the Postman Student Community Discord a better place by using moderation and fun commands !

Note to all developers

Be sure to not commit directly to the main. Happy coding !

Prerequisites

System requirement

  1. Any system with basic configuration.
  2. Operating System : Windows / Linux / Mac

Software requirement

  1. Node.JS
  2. Git

(Docker is nice but not required to run the project locally)

Skill requirement

  1. Git & Github
  2. Node.JS
  3. Discord.JS
  4. TypeScript

Running the Project Locally

Setting Up The Application

  1. Clone the project with git clone and cd into it
  2. Copy the env vars: cp .sampledotenv .env
  3. Get your secret key from Discord Developer Portal (make a bot for your app) and put it in the .env file as the value for DISCORD_TOKEN
  4. Run yarn install
  5. You are good to go! Now you can start the project by typing yarn dev

Commands

Active Commands

  • !p translate <text> -> Translate a message from another language to English
  • !p help-> Displays all commands
  • !p programs -> List all programs
  • !p meme -> Send a coding meme from Reddit
  • !p security -> Display the current number of attacks blocked
  • !p project -> Display a random project idea
  • !p pets -> Display a cute cat picture

Silent Commands

  • Scam Detection -> Every message is scanned for scams
  • Non Gender Netural Words Detection -> Every message is scanned for words like 'guys', 'dude', 'bro', etc..

Contributors :

postman-sentinel's People

Contributors

clairefro avatar ctnkaan avatar snyk-bot avatar softwarevirus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

postman-sentinel's Issues

Feature Request: Suggestions of gender neutral terms

Feature Request-

As this is a discord bot for Postman Student Community, it would be great if the bot could check all people's messages for inclusive language.

Phrases like hey guys or words like bro, ma'am are gendered and these can be replaced with hey folks and people or folk

Example:

Someone messages hey guys! i have some ..... Here the bot can reply with the message 👇

@user
You used the word "guys"
This might not be inclusive or welcoming language. 
Please update / edit your message with the following suggestions instead:
"guys" may be insensitive, use "person", "friend", "pal", "folk", "individual" instead
See above ^^
Live example (click to expand)

image

Solution

We can implement this using alexjs. There's an implementation(src) of this in EddieHubCommunity discord bot already, from which we can take reference.

Load Balancing issue.

I have seen that if multiple links are sent continues the bot will warn the user but will not delete the messages. I thought this issue is because of load balancing.

Add spam link detection

Not all spam link message include "nitro" keyword.

Most spam links are made to look similar to discord.gg or other valid links to trick users into clicking.

Let's calculate likelihood of spam based on levenshtein distance to the base URL "discord"

(I am working on a PR now)

const { distance } = require("fastest-levenshtein");

console.log("discord", distance("discord", "discord"));
console.log("discorde", distance("discord", "discorde"));
console.log("discrod", distance("discord", "discrod"));
console.log("disscorde", distance("discord", "disscorde"));
console.log("github", distance("discord", "github"));
console.log("stackoverflow", distance("discord", "stackoverflow"));

// For example: ban any link where baseUrl is less than 4 distance from "discord", but greater than 0

// --BAD -- : distance > 0 && distance < 4
// discorde 1
// discrod 2
// disscorde 2

// -- OK : distance === 0 || distance > 4
// discord 0
// github 6
// stackoverflow 10

Change action on spam detection

Great initiative Cetin - your bot has already blocked some spam!

My suggestions (I will make a PR later after your feedback).

On spam detection:

  1. Send a "Spam was deleted" message to only one designated channel, such as #bot-spam" (Currently the bot "spams" all the channels in the case of a multi-channel attack)
  2. Send a DM to the offending user, letting them know their message was deleted, and inform them their account was likely hacked. (Users are often unaware they have been hacked until someone tells them)

Add Docs

The project needs a documentation like every project

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.