Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

FynniX/krp-discord-bot-old

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

krp-discord-bot

A discord bot that does encrypt the mods for you.

Requirements

Windows

  • git
  • lock.exe (Piboso has the file)
  • Node.js (Tested with 18.17.0)

Linux

  • git
  • lock.exe (Piboso has the file)
  • Node.js (Tested with 18.17.0)
  • Wine (32 bit + 64 bit)

Ports

  • Make sure WEBSERVER_PORT is open

Role structure

  1. Patreon role

    Has access to all mods

  2. Mods specific role

    Only access to one mod

Folder structure

  • Mods Folder

    Put all unencrypted mods into that folder and name the file while creating the mod per command

Installing

General

  1. Open console

  2. Clone Repository:

    git clone https://github.com/FynniX/krp-discord-bot.git
  3. Open Bot Directory

    cd krp-discord-bot
  4. Install Packages

    npm install
  5. Setup Environment File

    Copy .env.example and rename it to .env

    • DATABASE_URL = "file://PATHTOFILE.db"
    • WEBSERVER_URL = http://YOURPUBLICIP:WEBSERVER_PORT
    • WEBSERVER_PORT (Define a free port for it)
    • MAX_THREADS (How many requests can be done simultaneously, be careful)
    • BOT_TOKEN (Discord bot token)
    • GUILD_ID (Discord server id)
    • PATREON_ROLE (Discord role for access to generating)
  6. Setup Prisma

    npm run generate
  7. Mods Folder

    Create a folder called mods Why?

  8. Install lock.exe

    Place lock.exe inside bot directory

  9. Build Source

    npm run build
  10. Start Bot

    npm start

Linux Extras

  1. Node.js

    wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
    export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
    nvm install 18.17.0
    nvm use 18.17.0
  2. Wine

    apt update
    apt install wine
    dpkg --add-architecture i386 && apt-get update && apt-get install wine32
  3. pm2

    Can be used to start the bot on startup and run in background.

    npm i -g pm2
    pm2 startup

    Skip step 9 in General Instructions and use this command

    pm2 start npm --name KRP-Discord-Bot -- run start
    pm2 save

License

Released under the MIT License.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published