Code Monkey home page Code Monkey logo

pwnedbot's Introduction

Python 3.7 CodeQL Quality Gate Status Security Rating

pwnedBot

A Heroku hosted Discord bot implementation of Troy Hunt's haveibeenpwned.com service,
a free resource for anyone to quickly assess if they may have been put
at risk due to an online account of their's having been compromised or
"pwned" in a data breach, using the hibpwned python library.

Prerequisites

Head over to DiscordApp and create a new app.
Record your Client_ID. On the left, click Bot, and then Add Bot.
Once you are done setting up your bot, save your Client_ID, Token, and Client Secret in a safe place.

Making calls to the haveibeenpwned API requires a key. You can purchase a HIBP-API-KEY here.

Create a Heroku account and install the Heroku CLI Tool. Follow the directions and run the command heroku login -i to authenticate your account.
If git is not already installed on your local host, install it.

Heroku Deployment

Create a fork of this repository, then clone it to your local host with the git clone command.
Navigate into the project's root directory and run heroku create. Take note of the name it assigns the app.
Run heroku git:remote -a <app name> to add a remote to your local repository.

Set the environment variables that the application will use with the heroku config:set command, setting the following variables:

heroku config:set HIBP_API_KEY=<your HIBP-API-KEY>
heroku config:set APP_NAME=<a unique app name for haveibeenpwned to recognize your app/bot>
heroku config:set DISCORD_TOKEN=<your discord bot TOKEN>
heroku config:set DISCORD_CLIENT_ID=<your discord CLIENT_ID>
heroku config:set BOT_PREFIX=<a prefix for your bot commands>

To deploy, push the code to your Heroku account with the command git push heroku master
To start the bot, issue the command heroku ps:scale worker=1

Development

Requirements

  • git >= 2.17.1
  • Python >= 3.6.9
  • python3-pip >= 20.0.2
    • hibpwned >= 1.1.1
    • Pillow >= 7.1.1
    • discord.py >= 1.3.3

Follow the steps above to deploy your application.
Log into your Heroku account, choose your app, and under Deploy click Connect to Github and follow the
directions to link your account, choose the repository, and set up automatic deployment on the master branch.
Now when you push changes to your Github project, they will automatically be deployed on your Heroku container.

Usage

To add bot to server add your Client_ID to this URL and visit in browser:
https://discordapp.com/oauth2/authorize?client_id= <Client_ID> &scope=bot
When bot is active in server type "(prefix)help" for a list of commands.

HELP BREACH_NAME PASSWORD SEARCH PASTES PASTE_ID

License

All data sourced from https://haveibeenpwned.com
Visit https://haveibeenpwned.com/API/v3 to read the Acceptable Use Policy
for rules regarding acceptable usage of this API.

This work is licensed under a Creative Commons Attribution 4.0 International License.
CCv4
plasticuproject

pwnedbot's People

Contributors

plasticuproject avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

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.