Git Product home page Git Product logo

impostor's Introduction

Impostor

Discord

This is the source code for the Discord bot and Among Us client that compromise Impostor. Note that Impostor is not intended for self-hosting (although it is theoretically possible), so if you want Impostor on your Discord server the easiest solution is to simply click here.

Demo

Demo Thumbnail

Components

This project consists of two components, creatively named bot and client. Bot is the Discord part written in TypeScript that handles all the logic around command handling, session management, member voice channel moving, etc. Client is a simple C# implementation of the Among Us networking protocol, just barely enough to connect to the lobby, fetch player data and emit events. Bot launches a client instance for every lobby, reading events from client through stdout.

Developing Bot

To get started with developing the bot, you'll need to install dependencies. First of all you need to have Node.js installed. After that, simply run npm/yarn install to get all the dependencies needed.

./node_modules/.bin/tsc -w will start a watching TypeScript compiler that will automatically compile the TypeScript source to JavaScript. After that, simply configure your .env by copying the template and filling in values, then run node dist/index.js to start the bot.

Note that you will also need a PostgreSQL database for running the bot.

Developing Client

For the client, be sure to clone the repository with submodules enabled, then simply open the solution in client/ to develop. You can also use the dotnet CLI to build the client, using dotnet build.

Step-by-Step Instructions for Self-Hosting Impostor

  1. Install Node.js + npm, .NET Core, PostgreSQL, and any others needed.
  2. Clone the repository recursively (git clone --recursive https://github.com/molenzwiebel/Impostor)
  3. Navigate to .env.template, duplicate the file, rename to .env, and fill in the blanks. The result will look something like this:
DISCORD_TOKEN=<your token here>
AU_CLIENT_DIR=../client/bin/Debug/netcoreapp3.1
DATABASE_URL=postgresql://postgres:<your password here>@localhost:5432/postgres
  1. Update the code associated with the emojis in bot/src/constants.ts (add the ID, name, etc)
  2. Navigate to /bot in your cmd/PowerShell/terminal
  3. Run npm install to install dependencies.
  4. Run ./node_modules/.bin/tsc to compile TypeScript to JavaScript.
  5. Run node dist/index.js (pm2 is recommended to keep it running for long periods)
  6. Change directory to /client
  7. Open cmd/PowerShell/terminal and run dotnet build

Note: When using Linux, I recommend setting up a .sh file to simplify the process when rebooting the bot, as some bugs in the code require a restart.

License

MIT

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.