Skip to content

Commit

Permalink
feat: Added better communication for invalid or missing subcommands
Browse files Browse the repository at this point in the history
  • Loading branch information
hiibolt committed Sep 2, 2024
1 parent dbd0ab4 commit afba64e
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 43 deletions.
84 changes: 43 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# r6rs
<img src="https://github.com/hiibolt/hiibolt/assets/91273156/9528b9af-4166-4b51-b3f8-084d75dccc3b" width="200"/>

### About
A General Purpose Discord Bot containing multiple powerful OSINT tools, designed to improve upon and run in tandem with [r6econ](https://github.com/hiibolt/r6econ).
A General Purpose Discord Bot for Tom Clancy's Rainbow Six Siege designed to improve upon and run in tandem with [r6econ](https://github.com/hiibolt/r6econ), but containing multiple powerful OSINT tools.

Includes many, many utilities for gathering open source intelligence via a variety of paid APIs in a succint, error-checked, and pretty looking package.

Expand All @@ -20,20 +22,6 @@ All commands are alternatively available as slash commands that better indicate

## Commands

### Admin

` >>admin announce <sections> <message>`
- Announces a message to all whitelisted users.

` >>admin whitelist <section> <user id>`
- Adds a person to the authorized user list.

` >>admin blacklist <section> <user id>`
- Removes a person from the authorized user list.

` >>admin dm <user id> <message>`
- DMs a message to a specific user.

### OSINT

#### Hashing
Expand All @@ -46,24 +34,24 @@ All commands are alternatively available as slash commands that better indicate

#### Queries

` >>osint query username <username>`
- Queries for leaks based on a username.
` >>osint query ip <ip>`
- Queries for leaks based on a last IP.

` >>osint query password <password>`
- Queries for leaks based on a password.

` >>osint query hash <hash>`
- Queries for leaks based on a hash.

` >>osint query ip <ip>`
- Queries for leaks based on a last IP.

` >>osint query name <name>`
- Queries for leaks based on a name.

` >>osint query email <email>`
- Queries for leaks based on an email.

` >>osint query hash <hash>`
- Queries for leaks based on a hash.

` >>osint query username <username>`
- Queries for leaks based on a username.

#### Other

` >>osint sherlock <username>`
Expand All @@ -77,42 +65,56 @@ All commands are alternatively available as slash commands that better indicate

### R6

#### Economy

` >>r6 econ profit <$ bought for> <item name | item id>`
- Calculates the amount you would make if you sold your item right now.

` >>r6 econ list`
` >>r6 econ list <page #>`
- Lists all available skins.

` >>r6 econ analyze <item name | item id>`
- Creates a detailed data sheet on an item.

` >>r6 econ graph <item name | item id>`
- Graphs the all-time history of an item.

` >>r6 econ transfer`
` >>r6 econ transfer <ubisoft email> <ubisoft password>`
- Finds the items with the least sellers either globally or on the account with the provided login.

#### OPSEC

` >>r6 opsec psn <username>`
- Looks up a Ubisoft account based on their registered PSN username.

` >>r6 opsec pc <username>`
- Looks up a Ubisoft account based on their registered PC username.

` >>r6 opsec applications <username>`
- Looks up a Ubisoft account based on their username (PC only).

` >>r6 opsec recon <username>`
- Analyzes a Ubisoft account for suspicious behaviour based on their username (PC only).

` >>r6 opsec pc <username>`
- Looks up a Ubisoft account based on their registered PC username.

` >>r6 opsec xbox <username>`
- Looks up a Ubisoft account based on their registered Xbox username.

#### Economy

` >>r6 econ analyze <item name | item id>`
- Creates a detailed data sheet on an item.
### Admin

` >>r6 econ profit <$ bought for> <item name | item id>`
- Calculates the amount you would make if you sold your item right now.
` >>admin dm <user id> <message>`
- DMs a message to a specific user.

` >>r6 econ list`
` >>r6 econ list <page #>`
- Lists all available skins.
` >>admin blacklist <section> <user id>`
- Removes a person from the authorized user list.

` >>r6 econ transfer`
` >>r6 econ transfer <ubisoft email> <ubisoft password>`
- Finds the items with the least sellers either globally or on the account with the provided login.
` >>admin announce <sections> <message>`
- Announces a message to all whitelisted users.

` >>r6 econ graph <item name | item id>`
- Graphs the all-time history of an item.
` >>admin whitelist <section> <user id>`
- Adds a person to the authorized user list.


## Setup
While open source, I do *not* provide setup instructions, nor do I plan to. This software is open source solely for the purpose of transparency. If such a tool interests you, join the [Discord](https://discord.gg/ENGqjywsbm) for details on purchasing access!
While open source, I do *not* provide setup instructions, nor do I plan to. This software is open source solely for the purpose of transparency. If such a tool interests you, join the [Discord](https://discord.gg/ENGqjywsbm) for details on purchasing access!
9 changes: 7 additions & 2 deletions src/helper/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,10 @@ impl R6RSCommand {
R6RSCommandType::RootCommand(R6RSRootCommand{ commands, section_title: _}) => {
let next_command = args
.pop_front()
.ok_or(anyhow!("Missing subcommand!"))?;
.ok_or_else(|| {
anyhow!("Missing subcommand!\n\nAvailable sub-commands: {}",
commands.keys().map(|key| format!("`{}`", key)).collect::<Vec<String>>().join(", "))
})?;

if next_command == "help" || next_command == ">>help" {
let mut body = self.description.to_owned() + "\n";
Expand All @@ -229,7 +232,9 @@ impl R6RSCommand {
}

if !commands.contains_key(&next_command) {
bail!("Invalid subcommand!\n\nRun >>help to see a list of commands!");
bail!("`{}` is not a valid subcommand!\n\nAvailable sub-commands: {}",
next_command,
commands.keys().map(|key| format!("`{}`", key)).collect::<Vec<String>>().join(", "));
}

commands.get_mut(&next_command)
Expand Down

0 comments on commit afba64e

Please sign in to comment.