Git Product home page Git Product logo

rustplus-discord-bot's Introduction

discord reddit donate on ko-fi

RustPlus-Discord-Bot

NOTE This is the old project, the newer and more advanced can be found here.

A NodeJS Discord Bot that uses the rustplus.js library to interact with Smart Devices, search for items for sale in vending machines, notify about in-game events such as Cargo Ship spawning or trigger of oilrig and other methods that is available through the Rust+ companion app.

How-To Setup

Setup Video

How to setup the RustPlus-Discord-Bot

Required Software

Follow the instructions for your operating system.

Windows

Download the following:

Ubuntu

Run the following commands:

$ sudo apt update
$ sudo apt install nodejs=14.17.3 npm=6.14.13 git

Arch Linux

Run the following command:

$ sudo pacman -S nodejs=14.17.3 npm=6.14.13 git

Setup the BOT

Open a terminal and run the following commands to clone the repository and install the required packages:

$ git clone https://github.com/alexemanuelol/RustPlus-Discord-Bot.git
$ cd RustPlus-Discord-Bot
$ npm install

Run the following command to register with FCM, Expo and link your Steam Account with Rust+.

$ npx @liamcottle/rustplus.js fcm-register

NOTE: Chrome/ Chromium is required for this step to work. It will open up an instance of the browser where you will have to sign in with your Steam Account and link with Rust+:

This will generate the configuration file rustplus.config.json which should remain in the same folder as the rustplusDiscordBot.js script.

Before we can start the BOT, we need to sort out the config.json file. There are some properties that needs to be filled out, these are:

  • steamId
  • serverIp
  • appPort
  • playerToken
  • token
  • botSpamChannel

The first 4 properties can easily be accessed by running the script:

$ cd tools/external
$ node copy_server_details_to_config.js

While this script is running, you simply join the rust server you want to play on, enter the menu and click on 'Rust+' and then press either 'PAIR WITH SERVER' or 'RESEND'. This will trigger a FCM notification that includes steamId, serverIp, appPort, playerToken and will automatically be copied into your config.json file.

token property can be gained by creating a Discord BOT for your Discord Server and copying the bot token into the config.json file.

botSpamChannel property can be gained by choosing one of the text channels in your Discord Server and simply copy the channel ID into the config.json file.

How to update the repository

Run the following commands:

$ git stash
$ git pull --rebase
$ git stash pop

Documentation

docs/documentation.md includes a detailed guide to all available commands and all the configuration settings.

Documentation

Screenshots and GIFs

TurnOn Smart Switches

Turn on Smart Switches

Pairing with Smart Devices

Pairing with Smart Devices

Running the help command

Help command

Running the getMap command

getMap command

Running the market command with assault as keyword

Market search

CargoShip active notification

Cargo Ship active

Explosion detected notification

Explosion detected

Thanks to

liamcottle@GitHub - for the rustplus.js library

rustplus-discord-bot's People

Contributors

alexemanuelol avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

rustplus-discord-bot's Issues

rustplus.config.json dont exist in root folder

The error:
[ERROR] rustplus.config.json file does not exist inside root folder. Try running the command: 'npx @liamcottle/rustplus.js fcm-register' and then place the output 'rustplus.config.json' file in the root folder of the RustPlus-Discord-Bot.

what I tried to run
node tools/external/copy_server_details_to_config.js

I have rustplus.config.json in my root folder.

Commands from Discord Bots

I’ve been using your discord Rust Plus with my group for the past two weeks or so and we really enjoy it, just wondering if it is possible to allow your discord bot to take commands from another discord bot? I have my streamdeck set up using webhooks so when i push a button a webhook bot will say “!turnOn turrets” in the correct channel, but your bot ignores it since it is coming from a discord bot, is this something I could easily change? or maybe in a future update?

Thanks

Enhancements

Add to sensitive commands like "removeAllDevices" something like need administrator to run this command or only you can use command in specific channel beacuse everyone can use this commands in the guild because there is abuse with others members

Information.

Hi, nice project amazing, but i have new ideas for add but idk where i can get info about rust+ msgs, i need know what msgs rust + send to app ?

I like to make Oil rig crates (loted, called, etc) i know other app paid do this with same .js if u can help me plis for get info about this.

The final question is , Where RUST+ post all events to app ? , for hook oil rigs , patrol , bradly , etc etc

Solve Bug To run bot

you need to edit line 4 from package.json "main": "bot.js", to "main": "rustplusDiscordBot.js",

Enhancements

Here is my suggestion to enhance the experience with the bot:

  1. Enable/Disable Switch with Reactions
    image

  2. Show contents of Vending Machine/Large Box via images portraying the respective item.

  3. Show connected TC Upkeep
    image

  4. Show Server Information
    image

Bug : Uncaught Error Error: ENOENT: no such file or directory, open './config.json'

Hello, i been following the documentation about this bot yesterday.
Everything is set up, Rust+ is paired with the server, the config had been wrote from this "FCM" and i copied my discord token and the id of the spam text channel in the config.js.

Now i want to run the script "rustplusDiscordBot.js" to start the bot and this error occures in my debug console:

D:\Program Files\nodejs\node.exe .\rustplus\RustPlus-Discord-Bot-main\rustplusDiscordBot.js
Uncaught Error Error: ENOENT: no such file or directory, open './config.json'
    at handleErrorFromBinding (internal/fs/utils:344:5)
    at openSync (fs:585:3)
    at readFileSync (fs:453:35)
    at readJSON (c:\Users\nette\Desktop\code\rustplusweb\rustplus\RustPlus-Discord-Bot-main\tools\tools.js:7:23)
    at <anonymous> (c:\Users\nette\Desktop\code\rustplusweb\rustplus\RustPlus-Discord-Bot-main\rustplusDiscordBot.js:116:20)
    at Module._compile (internal/modules/cjs/loader:1105:14)
    at Module._extensions..js (internal/modules/cjs/loader:1159:10)
    at Module.load (internal/modules/cjs/loader:981:32)
    at Module._load (internal/modules/cjs/loader:822:12)
    at executeUserEntryPoint (internal/modules/run_main:77:12)
    at <anonymous> (internal/main/run_main_module:17:47)

I know what the error "means" but i dont know why the script dosnt find the config.json.
Thats my project folder. There you can clearly see the config.json.
image
image

Ive been coding with nodejs for a while and my theory is that there is maybe something up with ur code or im way to dumb to see my mistakes.

I hope you can help me,
THX

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.