Giter Site home page Giter Site logo

maxcurrent / dc29-discord-signalbot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rx13/dc29-discord-signalbot

0.0 0.0 0.0 36 KB

A python discord client interaction emulator for the DC29 badge code channel

License: MIT License

Python 100.00%

dc29-discord-signalbot's Introduction

dc29-discord-signalbot

A python discord client interaction emulator for the DC29 badge code channel

Prep

Open Developer mode

Open the developer mode for your browser

  • chrome - CTRL + SHIFT + j
  • Firefox - CTRL + SHIFT + i

in Developer tools for that window, click the "NETWORK" tab.

Login to Discord on the browser

Before you start this script, login to discord.gg in your browser. Open the web-app version of discord. Navigate to the DefCon server.

Find request to 'messages' endpoint in Developer Tools window

In the developer tools NETWORK tab, hit the "DO NOT ENTER" / "Trash Can" icon (depdending on browser) to clear the network history log.

now hard-refresh the discord window (CTRL + SHIFT + R)

In the network tab you're going to see a lot of data. Find one of the URL path entries that looks like messages?limit=##

Select the entry, and look at HEADERS on the right. Scroll down to "REQUEST HEADERS".

Collect TWO headers from request to 'messages' endpoint

You need TWO headers:

  • x-super-properties
  • authorization

These will be set as DISCORD_AUTHORIZATION and DISCORD_XSUPER in your environment respectively.

Set environment variables

set these in your environment you're running the script from:

  • Linux - export DISCORD_AUTHORIZATION=<authorization header data>

  • Windows - set DISCORD_AUTHORIZATION=<authorization header data>

      set DISCORD_AUTHORIZATION=abcd1234abcd1234abcd.12345.abcd1234abcd1234
      set DISCORD_XSUPER=eby-some-long.string.of-text
      set DISCORD_USER=yourUserName
      set BADGE_SERIAL_PORT=yourSerialPortCom3Tty
    

Note your com/tty port for the USB Serial connection

Grab your COM# or /dev/tty number for your badge (whatever you're using to connect via Putty, etc)

  • example: COM2 or /dev/tty2 or /dev/serial0 (etc)

Usage

Now you're ready to install the required packages.

!!! NOTICE !!! - Terms of service with Discord are not straight forward. This could potentially cause discord to warn/flag/suspend your account if you abuse the API interfaces.

Setup

# from within this directory

python3 -m venv .
. bin/activate 

# windows: \Scripts\Activate.bat
# or powershell -Ex bypass \Scripts\Activate.ps1

pip install -r requirements.txt

You will need to edit main.py.

  • Replace DISCORD_USER username with your username
  • Replace BADGE_CHANNEL with your com/tty device name

Run

# for testing/etc
python3 main.py --interactive

# to run live
python3 main.py

dc29-discord-signalbot's People

Contributors

rx13 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.