Skip to content

Made move command #461

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 0 additions & 26 deletions .github/ISSUE_TEMPLATE/bug_report.md

This file was deleted.

20 changes: 0 additions & 20 deletions .github/ISSUE_TEMPLATE/feature_request.md

This file was deleted.

38 changes: 19 additions & 19 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
on:
push:
pull_request:
jobs:
lint:
name: Lint - Node ${{ matrix.node }}
runs-on: ubuntu-latest
strategy:
matrix:
node: [ 22 ]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: 'npm'
- run: npm install
- run: npm test
on:
push:
pull_request:

jobs:
lint:
name: Lint - Node ${{ matrix.node }}
runs-on: ubuntu-latest
strategy:
matrix:
node: [ 14, 16, 18 ]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: 'npm'
- run: npm install
- run: npm test
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ instances
credentials
maps
logs
temp
temp
2 changes: 1 addition & 1 deletion config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ module.exports = {
token: process.env.RPP_DISCORD_TOKEN || '',
needAdminPrivileges: process.env.RPP_NEED_ADMIN_PRIVILEGES || true, /* If true, only admins can delete (server, switch..), manage credentials and reset a channel */
}
};
};
15 changes: 15 additions & 0 deletions docs/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@ In-Game Command | Description
[**marker**](commands.md#marker) | Set custom markers anywhere on the map.
[**market**](commands.md#market-ingame) | Search for items in vending machines or subscribe/unsubscribe to items.
[**mute**](commands.md#mute) | Mute the bot from the In-Game Team Chat.
[**move**](commands.md#move) | Move user to a different channel.
[**note/notes**](commands.md#notenotes) | Create notes about meaningful things.
[**offline**](commands.md#offline) | Get the currently offline players in your team.
[**online**](commands.md#online) | Get the currently online players in your team.
Expand Down Expand Up @@ -535,6 +536,20 @@ Subcommand | Description | Required

![In-Game Command mute Image](images/ingame_commands/mute_ingame.png)

## **move**

> **Move users between voice channels.** Use this to move yourself or other users to a specified voice channel.

<br>Command format: `!move [user1] [user2] [...] <target_channel> `

* `target_channel`: Name or ID of the destination voice channel (**required**)
* `user1`, `user2`, ... : Mention or ID of the users to move (**optional**). If not specified, it moves **you**.

### **Examples**

* `!move General` – Moves **you** to the **General** voice channel
* `!move Alle Gaming` – Moves **Alle** to the **Gaming** channel
* `!move 123456789012345678` – Moves **you** to the voice channel with that **ID**

## **note/notes**

Expand Down
40 changes: 20 additions & 20 deletions docs/installation.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# Installation Documentation
## Required Software
Program | Version | Download | Note
------- | ------- | -------- | ----
`NodeJS` | >= 22.12.0 | [**here**](https://nodejs.org/en/download/) | Since discordjs v14 is used, the version needs to be at least 22.12.0.
`Git` | Any | [**here**](https://git-scm.com/downloads) | &nbsp;
## Optional Software
To enable step-trace for cargoship and patrol helicopter, [**GraphicsMagick**](http://www.graphicsmagick.org/download.html) needs to be downloaded.
## Clone the repository
Open a terminal (`Git Bash` / `CMD` / `Terminal` / `PowerShell` or similar) and run the following commands:
$ git clone https://github.com/alexemanuelol/rustplusplus.git
$ cd rustplusplus
$ npm install
# Installation Documentation

## Required Software

Program | Version | Download | Note
------- | ------- | -------- | ----
`NodeJS` | >= 16.9 | [**here**](https://nodejs.org/en/download/) | Since discordjs v14 is used, the version needs to be at least 16.9.
`Git` | Any | [**here**](https://git-scm.com/downloads) | &nbsp;

## Optional Software
To enable step-trace for cargoship and patrol helicopter, [**GraphicsMagick**](http://www.graphicsmagick.org/download.html) needs to be downloaded.


## Clone the repository

Open a terminal (`Git Bash` / `CMD` / `Terminal` / `PowerShell` or similar) and run the following commands:

$ git clone https://github.com/alexemanuelol/rustplusplus.git
$ cd rustplusplus
$ npm install
88 changes: 44 additions & 44 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
{
"name": "rustplusplus",
"version": "1.22.0",
"description": "A NodeJS Discord Bot that uses the rustplus.js library to utilize the power of the Rust+ Companion App with additional Quality-of-Life features.",
"main": "index.ts",
"scripts": {
"start": "ts-node .",
"preinstall": "npx npm-force-resolutions",
"test": "tsc --noEmit -p ."
},
"repository": {
"type": "git",
"url": "https://github.com/alexemanuelol/rustplusplus.git"
},
"author": "Alexemanuelol",
"license": "SEE LICENSE IN LICENSE",
"bugs": {
"url": "https://github.com/alexemanuelol/rustplusplus/issues"
},
"homepage": "https://github.com/alexemanuelol/rustplusplus#readme",
"dependencies": {
"@discordjs/rest": "^2.5.1",
"@discordjs/voice": "^0.18.0",
"@formatjs/intl": "^2.6.9",
"@liamcottle/push-receiver": "^0.0.4",
"@liamcottle/rustplus.js": "git+https://github.com/alexemanuelol/rustplus.js.git#089cfd3db1b04709911948bce669273139c6a124",
"axios": "^1.3.4",
"colors": "^1.4.0",
"discord-api-types": "^0.38.14",
"discord.js": "^14.21.0",
"ffmpeg-static": "^5.1.0",
"gm": "^1.25.0",
"jimp": "^0.22.7",
"libsodium-wrappers": "^0.7.11",
"lodash": "^4.17.21",
"translate": "^1.4.1",
"ts-node": "^10.9.2",
"typescript": "^5.8.3",
"winston": "^3.8.2"
},
"resolutions": {
"jpeg-js": "0.4.4",
"protobufjs": "7.2.4"
}
{
"name": "rustplusplus",
"version": "1.22.0",
"description": "A NodeJS Discord Bot that uses the rustplus.js library to utilize the power of the Rust+ Companion App with additional Quality-of-Life features.",
"main": "index.ts",
"scripts": {
"start": "ts-node .",
"preinstall": "npx npm-force-resolutions",
"test": "tsc --noEmit -p ."
},
"repository": {
"type": "git",
"url": "https://github.com/alexemanuelol/rustplusplus.git"
},
"author": "Alexemanuelol",
"license": "SEE LICENSE IN LICENSE",
"bugs": {
"url": "https://github.com/alexemanuelol/rustplusplus/issues"
},
"homepage": "https://github.com/alexemanuelol/rustplusplus#readme",
"dependencies": {
"@discordjs/rest": "^1.6.0",
"@discordjs/voice": "^0.16.0",
"@formatjs/intl": "^2.6.9",
"@liamcottle/push-receiver": "^0.0.4",
"@liamcottle/rustplus.js": "git+https://github.com/alexemanuelol/rustplus.js.git#089cfd3db1b04709911948bce669273139c6a124",
"axios": "^1.3.4",
"colors": "^1.4.0",
"discord-api-types": "^0.37.37",
"discord.js": "^14.8.0",
"ffmpeg-static": "^5.1.0",
"gm": "^1.25.0",
"jimp": "^0.22.7",
"libsodium-wrappers": "^0.7.11",
"lodash": "^4.17.21",
"translate": "^1.4.1",
"ts-node": "^10.9.1",
"typescript": "^4.8.2",
"winston": "^3.8.2"
},
"resolutions": {
"jpeg-js": "0.4.4",
"protobufjs": "7.2.4"
}
}
7 changes: 1 addition & 6 deletions src/discordTools/discordEmbeds.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@ const DiscordTools = require('./discordTools.js');
const InstanceUtils = require('../util/instanceUtils.js');
const Timer = require('../util/timer');

function isValidUrl(url) {
if (url.startsWith('https') || url.startsWith('http')) return true;
return false;
}

module.exports = {
getEmbed: function (options = {}) {
const embed = new Discord.EmbedBuilder();
Expand Down Expand Up @@ -602,7 +597,7 @@ module.exports = {
footer: { text: body.name },
title: data.title,
description: data.message,
thumbnail: (body.img !== '' && isValidUrl(body.img)) ? body.img : 'attachment://rocket.png'
thumbnail: body.img !== '' ? body.img : 'attachment://rocket.png'
});
},

Expand Down
4 changes: 4 additions & 0 deletions src/handlers/inGameCommandHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ module.exports = {
commandLowerCase.startsWith(`${prefix}${client.intlGet(guildId, 'commandSyntaxLeader')}`)) {
rustplus.sendInGameMessage(await rustplus.getCommandLeader(command, callerSteamId));
}
else if (commandLowerCase.startsWith(`${prefix}${client.intlGet('en', 'commandSyntaxMove')} `) ||
commandLowerCase.startsWith(`${prefix}${client.intlGet(guildId, 'commandSyntaxMove')} `)) {
rustplus.sendInGameMessage(await rustplus.handleMoveCommand(command, callerSteamId, callerName));
}
else if ((commandLowerCase.startsWith(`${prefix}${client.intlGet('en', 'commandSyntaxMarker')} `) ||
commandLowerCase === `${prefix}${client.intlGet('en', 'commandSyntaxMarkers')}`) ||
(commandLowerCase.startsWith(`${prefix}${client.intlGet(guildId, 'commandSyntaxMarker')} `) ||
Expand Down
11 changes: 11 additions & 0 deletions src/languages/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@
"channelNameSwitches": "přepínače",
"channelNameTeamchat": "týmový chat",
"channelNameTrackers": "trackery",
"channelNotFound": "Nepodařilo se najít kanál: {channel}",
"errorFindingChannel": "Chyba při hledání kanálu: {error}",
"chinook47": "Chinook 47",
"chinook47DetectedSetting": "Když na mapu vstoupí Chinook 47, pošleti notifikaci.",
"chinook47EntersMap": "Chinook 47 vstupuje na mapu z {location} aby vyhodil uzamčenou bednu.",
Expand Down Expand Up @@ -126,6 +128,7 @@
"commandSyntaxLanguage": "jazyk",
"commandSyntaxLarge": "velký",
"commandSyntaxLeader": "vůdce",
"commandSyntaxMove": "přesunout",
"commandSyntaxList": "list",
"commandSyntaxMarker": "marker",
"commandSyntaxMarkers": "markery",
Expand Down Expand Up @@ -285,6 +288,14 @@
"couldNotDeleteChannel": "Kanál nelze odstranit: {channelId}",
"couldNotDeleteMessage": "Could not delete message: {message}",
"couldNotFindAnyPlayers": "Could not find any players.",
"playersNotFound": "Nepodařilo se najít žádné odpovídající hráče.",
"multipleChannelsFound": "Nalezeno více kanálů: {channels}. Zadejte prosím přesnější název.",
"movedToChannel": "Přesunuto {count} hráč(ů) na kanál {channel}: {players}",
"userNotInVoice": "{user} není v hlasovém kanálu.",
"userAlreadyInChannel": "{user} je již v cílovém hlasovém kanálu.",
"failedToMoveUser": "Nepodařilo se přesunout uživatele {user}.",
"commandSyntaxMoveHelp": "Použití: .move [uživatel1 uživatel2 ...] <kanál> nebo .move <kanál> pro přesun sebe",
"noLinkedUserFound": "Nenalezen žádný propojený Discord účet. Propojte si účet nebo určete uživatele k přesunutí.",
"couldNotFindCategory": "Could not find category: {category}",
"couldNotFindChannel": "Could not find channel: {channel}",
"couldNotFindCraftDetails": "Podrobnosti o craftu pro {name} nelze najít.",
Expand Down
11 changes: 11 additions & 0 deletions src/languages/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@
"channelNameSwitches": "schalter",
"channelNameTeamchat": "teamchat",
"channelNameTrackers": "tracker",
"channelNotFound": "Konnte den Kanal nicht finden: {channel}",
"errorFindingChannel": "Fehler beim Finden des Kanals: {error}",
"chinook47": "Transporthubschr.",
"chinook47DetectedSetting": "Wenn der Transporthubschrauber auf der Karte erscheint, sende eine Benachrichtigung.",
"chinook47EntersMap": "Transporthubschrauber erscheint auf der Karte [{location}], um eine gesperrte Kiste abzuwerfen.",
Expand Down Expand Up @@ -126,6 +128,7 @@
"commandSyntaxLanguage": "sprache",
"commandSyntaxLarge": "groß",
"commandSyntaxLeader": "anführer",
"commandSyntaxMove": "verschieben",
"commandSyntaxList": "liste",
"commandSyntaxMarker": "markierung",
"commandSyntaxMarkers": "markierungen",
Expand Down Expand Up @@ -285,6 +288,14 @@
"couldNotDeleteChannel": "Konnte Kanal nicht löschen: {channelId}",
"couldNotDeleteMessage": "Konnte Nachricht nicht löschen: {message}",
"couldNotFindAnyPlayers": "Konnte keine Spieler finden.",
"playersNotFound": "Keine passenden Spieler gefunden.",
"multipleChannelsFound": "Mehrere Kanäle gefunden: {channels}. Bitte gib einen genaueren Namen an.",
"movedToChannel": "{count} Spieler wurden in den Kanal {channel} verschoben: {players}",
"userNotInVoice": "{user} befindet sich nicht in einem Sprachkanal.",
"userAlreadyInChannel": "{user} befindet sich bereits im Ziel-Sprachkanal.",
"failedToMoveUser": "Verschieben von {user} fehlgeschlagen.",
"commandSyntaxMoveHelp": "Verwendung: .move [user1 user2 ...] <Kanal> oder .move <Kanal>, um dich selbst zu verschieben.",
"noLinkedUserFound": "Kein verknüpfter Discord-Account gefunden. Bitte verknüpfe deinen Account oder gib Benutzer an, die verschoben werden sollen.",
"couldNotFindCategory": "Konnte Kategorie nicht finden: {category}",
"couldNotFindChannel": "Konnte Kanal nicht finden: {channel}",
"couldNotFindCraftDetails": "Konnte keine Details zur Herstellung von {name} finden.",
Expand Down
11 changes: 11 additions & 0 deletions src/languages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@
"channelNameSwitches": "switches",
"channelNameTeamchat": "teamchat",
"channelNameTrackers": "trackers",
"channelNotFound": "Could not find channel: {channel}",
"errorFindingChannel": "Error finding channel: {error}",
"chinook47": "Chinook 47",
"chinook47DetectedSetting": "When a Chinook 47 enters the map, send a notification.",
"chinook47EntersMap": "Chinook 47 enters the map from {location} to drop off Locked Crate.",
Expand Down Expand Up @@ -126,6 +128,7 @@
"commandSyntaxLanguage": "language",
"commandSyntaxLarge": "large",
"commandSyntaxLeader": "leader",
"commandSyntaxMove": "move",
"commandSyntaxList": "list",
"commandSyntaxMarker": "marker",
"commandSyntaxMarkers": "markers",
Expand Down Expand Up @@ -285,6 +288,14 @@
"couldNotDeleteChannel": "Could not delete channel: {channelId}",
"couldNotDeleteMessage": "Could not delete message: {message}",
"couldNotFindAnyPlayers": "Could not find any players.",
"playersNotFound": "Could not find any matching players.",
"multipleChannelsFound": "Multiple channels found: {channels}. Please provide a more precise name.",
"movedToChannel": "Moved {count} player(s) to {channel}: {players}",
"userNotInVoice": "{user} is not in a voice channel.",
"userAlreadyInChannel": "{user} is already in the target voice channel.",
"failedToMoveUser": "Failed to move {user}.",
"commandSyntaxMoveHelp": "Usage: .move [user1 user2 ...] <channel> or .move <channel> to move yourself",
"noLinkedUserFound": "No linked Discord account found. Please link your account or specify users to move.",
"couldNotFindCategory": "Could not find category: {category}",
"couldNotFindChannel": "Could not find channel: {channel}",
"couldNotFindCraftDetails": "Could not find craft details for {name}.",
Expand Down
Loading