An open API service indexing awesome lists of open source software.

https://github.com/garulf/sc-discord-bot


https://github.com/garulf/sc-discord-bot

Last synced: 10 days ago
JSON representation

Awesome Lists containing this project

README

          

# SC Discord Bot

A Star Citizen Discord bot that provides ship info, item lookups, commodity trading routes, and live RSI server status — all via slash commands.

## Commands

### Inventory
| Command | Description |
|---|---|
| `/inventory add ` | Add a DCHS item to your inventory (DCHS-01 through DCHS-07) |
| `/inventory remove ` | Remove a DCHS item from your inventory |
| `/inventory clear` | Clear all items from your inventory |
| `/inventory status` | Show all members' DCHS items and complete sets |

### Items & Equipment
| Command | Description |
|---|---|
| `/find all ` | Search across all item types at once |
| `/find weapon ` | Search FPS weapons |
| `/find shipweapon ` | Search ship-mounted weapons |
| `/find armor ` | Search armor |
| `/find clothes ` | Search clothing |
| `/find vehicleitem ` | Search vehicle/ship components (cooler, shield, power plant, etc.) |
| `/find weaponattachment ` | Search FPS weapon attachments |
| `/find item ` | Search miscellaneous items |

### Ships
| Command | Description |
|---|---|
| `/ship ` | Ship stats (crew, cargo, speed, hull, signals) and cheapest aUEC buy price |
| `/shipprice ` | All in-game buy and rental locations for a ship |

### Trading
| Command | Description |
|---|---|
| `/commodity buy ` | Best terminals to buy a commodity |
| `/commodity sell ` | Best terminals to sell a commodity |
| `/commodity route` | Top profitable buy→sell routes with optional filters |

### Executive Hangar
| Command | Description |
|---|---|
| `/hangar set` | Set the current hangar phase (charging / open / resetting) |
| `/hangar status` | Show current hangar status |
| `/hangar subscribe` | Post a live auto-updating hangar status in this channel |
| `/hangar unsubscribe` | Remove the live status from this channel |

### RSI Server Status
| Command | Description |
|---|---|
| `/status show` | Show current RSI server status |
| `/status subscribe` | Post RSI status alerts in this channel |
| `/status unsubscribe` | Stop RSI status alerts in this channel |

## Setup

### Prerequisites
- Docker and Docker Compose
- A Discord bot token
- A UEX bearer token (for trading/price commands)

### Configuration

Copy `.env.example` to `.env` and fill in the values:

```env
DISCORD_TOKEN=your_discord_bot_token
UEX_BEARER_TOKEN=your_uex_token
```

### Running

```bash
# Start the bot
docker compose up -d

# Start with live reload on file changes (development)
./run.ps1
```

### Discord Bot Permissions

The bot requires the following when creating its application:
- `applications.commands` scope (slash commands)
- No privileged intents required

## Data Sources

- **[star-citizen.wiki](https://star-citizen.wiki)** — ship stats, weapons, armor, clothing, and other item data
- **[UEX](https://uexcorp.space)** — in-game aUEC prices for commodities, ships, and equipment

## Development

Bot state (hangar schedule, subscriptions, API cache) is stored in a SQLite database at `/app/data/bot.db`, persisted via the `bot-data` Docker volume.

## Releases

Releases are managed automatically by [release-please](https://github.com/googleapis/release-please). On every merge to `main`, the action opens (or updates) a release PR that bumps the version in `pyproject.toml` and updates `CHANGELOG.md`. Merging that PR creates the git tag and GitHub Release.

## Contributing

Commit messages must follow the [Conventional Commits](https://www.conventionalcommits.org/) format so release-please can determine the next version:

| Prefix | Effect |
|---|---|
| `fix:` | patch bump (`0.1.0` → `0.1.1`) |
| `feat:` | minor bump (`0.1.0` → `0.2.0`) |
| `feat!:` or `BREAKING CHANGE:` footer | major bump (`0.1.0` → `1.0.0`) |
| `chore:`, `docs:`, `refactor:`, `test:`, `ci:` | no version bump |

To enable local commit-message validation after cloning, run:

```bash
pre-commit install --hook-type commit-msg
```