command permissions, readme update, and command logic enhancements

This commit is contained in:
2025-03-02 01:44:53 +01:00
parent ec7315ebfd
commit 9a87342dd2
4 changed files with 68 additions and 45 deletions
+27 -11
View File
@@ -2,7 +2,7 @@
An automation tool for Byte Dice. It's both a Discord and Reddit bot in one program.
> [!CAUTION]
> This tool is not intended for public use outside of the official Byte Dice Assistant bots. Expect issues if you host this yourself.
> This tool is not intended for public use outside of the official *Byte Dice Assistant* bots. Expect issues if you host this yourself.
# Open-source - Copyright
@@ -31,21 +31,37 @@ You can install Python modules by running `$ pip install {module}` or `$ python
### Environment variables:
| **Name** | **Description** |
| --- | --- |
| `ASSISTANT_TOKEN` | The Discord bot token. |
| `ASSISTANT_TOKEN_TEST` | (Optional) A testing Discord bot token. This is only needed when the program is ran with `-t` or `--test`. |
| `ASSISTANT_DM_USER` | (Optional) Your Discord user id. The assistant will DM this user when *certain* errors occur. |
| `ASSISTANT_R_ID` | The id for the Reddit bot/account. |
| `ASSISTANT_TOKEN` | The Discord bot token. (Create a Discord bot [here](https://discord.com/developers/docs/intro)!) |
| `ASSISTANT_TOKEN_TEST` | (Optional) A testing Discord bot token. This is only needed when the program is run with `-t` or `--test`. |
| `ASSISTANT_DM_USER` | (Optional) Your Discord user ID. The assistant will DM this user when *certain* errors occur. |
| `ASSISTANT_R_ID` | The id for the Reddit bot/account. (Create a Reddit bot [here](https://www.reddit.com/prefs/apps)!) |
| `ASSISTANT_R_TOKEN` | The token for the Reddit bot/account. |
| `ASSISTANT_R_NAME` | The username of the Reddit bot/account. |
| `ASSISTANT_R_PASS` | The password for the Reddit bot/account. |
| `ASSISTANT_OWNERS` | A list of user ids that "own" the bot. Separate each owner with a comma and NO spaces. |
| `ASSISTANT_OWNERS` | (OPTIONAL) A list of Discord user IDs that "own" the bot. Separate each ID with a single comma and **no** spaces. |
### Required permissions:
**These are automatically set if you use the [official invite link](https://discord.com/oauth2/authorize?client_id=1212127255795335208&permissions=84992&integration_type=0&scope=bot).**
* Send Messages
* and... nothing else.
* Read Message History
* View Channels
* Embed Links
### How to run:
* Download the code (and extract if needed).
* Open a terminal and CD to the downloaded folder.
* Run `$ cargo run`. There are more options when running. You can view a list of those using `$ cargo run -- --help` or `$ cargo run -- -h`.
* If you want to only run the Python code, you can either run `$ cargo run -- --py`, or `$ python ./src/python/main.py`. The second option is recommended for better error output.
* Download the code (and extract it if needed).
* Open a terminal.
* Set the environment variables.
* On Windows:
* Run `$ setx VARIABLE_NAME "value"` in a terminal.
* On Unix (Linux / Mac):
* Run `$ sudo nano /etc/environment` or `$ sudo vim /etc/environment` in the terminal.
* press `i` (only if you used VIM).
* write `VARIABLE_NAME="value"` + a new line for every variable.
* if nano: `ctrl + O` (and press enter) then `ctrl + X`.
* if VIM: press `esc` then write `:wq` (and press enter).
* Restart the terminal if you added/changed the environment variables.
* Run `$ cd path/to/extracted/folder`.
* Run `$ cargo run`. You can view a list of options by running `$ cargo run -- --help` or `$ cargo run -- -h`.
* If you only want to run the Python code, you can either run `$ cargo run -- --py`, or `$ python ./src/python/main.py`. The second option is recommended for better error output.