From 8083fb15e858883c991fc5a8eff17ddb15062482 Mon Sep 17 00:00:00 2001 From: plun1331 Date: Tue, 5 May 2026 14:09:58 -0700 Subject: [PATCH 1/7] Create configuration documentation in config.md Added configuration documentation for server, account, Discord, settings, Redis, and extensions. --- config.md | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 config.md diff --git a/config.md b/config.md new file mode 100644 index 0000000..b734bfb --- /dev/null +++ b/config.md @@ -0,0 +1,67 @@ +# Configuration + +## Server +| Key | Type | Description | Default | +|---------------|------|-------------------------------------|------------------| +| `SERVER_HOST` | str | The host to connect to. | `mc.hypixel.net` | +| `SERVER_PORT` | int | The port to connect to on the host. | `25565` | + +## Account +| Key | Type | Description | Default | +|-----------------|------|-------------------------------------------------------------------------------------|---------| +| `ACCOUNT_EMAIL` | str | Not actually useful, serves as an internal identifier for the account you're using. | | + +## Discord +| Key | Type | Description | Default | +|----------------------------------|-----------|----------------------------------------------------------------------------------------------------------------------------------------|---------| +| `DISCORD_TOKEN` | str | Discord bot token. | | +| `DISCORD_CHANNEL` | int | Channel ID for your bridge messages. | | +| `DISCORD_ALLOWCROSSCHAT` | list[int] | Channel IDs for which to allow "Cross Chat", which sends messages from other bridge bots to your guild. Formatted like so: `ID,ID,...` | | +| `DISCORD_OFFICERCHANNEL` | int | Channel ID for your officer chat messages. | | +| `DISCORD_ALLOWOFFICERCROSSCHAT` | list[int] | Same as `DISCORD_ALLOWCROSSCHAT`, but for officer chat. | | +| `DISCORD_COMMANDROLE` | int | Your "Guild Staff" role, allows members with the role to take staff actions with the bot (invite, kick, mute, etc.) | | +| `DISCORD_OVERRIDEROLE` | int | Your admin role, allows members with the role to use administrative commands such as `!override`. | | +| `DISCORD_OWNERID` | int | Functionally the same as `DISCORD_OVERRIDEROLE`, but for one user instead. | | +| `DISCORD_PREFIX` | str | The prefix for the bot. | `!` | +| `DISCORD_WEBHOOKURL` | str | If set, the bot will send webhook messages that appear to be from the Minecraft users, instead of embeds from the bot. | | +| `DISCORD_DEBUGWEBHOOKURL` | str | Outputs some of the bot's logs to this webhook. Not useful unless you know what you're doing. | | +| `DISCORD_SERVERNAME` | str | When using `DISCORD_WEBHOOKURL`, messages from the bridge bot will use this name as the webhook's name. | | +| `DISCORD_IGNORECROSSCHATWARNING` | bool | Silences the warning in the terminal when crosschat is enabled. | `false` + +## Settings +| Key | Type | Description | Default | +|-------------------------------|-----------|------------------------------------------------------------------------------------------------------------------------------|---------| +| `SETTINGS_AUTOACCEPT` | bool | Autoaccept guild invites. | `false` | +| `SETTINGS_DATELIMIT` | int | Date range limit for the `!top` command. Limited by Hypixel, so changing this value to something bigger will have no effect. | `30` | +| `SETTINGS_EXTENSIONS` | list[str] | List of `discord.py` extensions to load. There are two built-in: `.game_commands` and `.mute_sync`. | | +| `SETTINGS_PRINTCHAT` | bool | If enabled, prints all chat messages to the terminal. | `false` | +| `SETTINGS_HIDEINVITEMESSAGES` | bool | Hides invite messages from being sent to bridge chat. | `false` | + +## Redis +Optional and not useful unless you know what you're doing. +| Key | Type | Description | Default | +|------------------------|------|---------------------------------------------------|---------| +| `REDIS_HOST` | str | Hostname for the redis server. | | +| `REDIS_PORT` | int | Port for the redis server. | | +| `REDIS_PASSWORD` | str | Redis server password, if requirepass is enabled. | | +| `REDIS_CLIENTNAME` | str | Client name to use for pub/sub. | | +| `REDIS_RECEIVECHANNEL` | str | Pub/sub channel to receive messages on. | | +| `REDIS_SENDCHANNEL` | str | Pub/sub channel to send messages on. | | + +## Extensions +### `.mute_sync` +| Key | Type | Description | Default | +|------------------------------|------|------------------------------------|---------| +| `MUTE_SYNC_MUTE_ROLE` | int | The role to apply for guild mutes. | | +| `MUTE_SYNC_HYPIXEL_API_KEY` | str | Hypixel API key. | | +| `MUTE_SYNC_SKYKINGS_API_KEY` | str | SkyKings API key. | | + +### `.game_commands` +Uses `DISCORD_PREFIX` (see above) as the prefix for commands. +| Key | Type | Description | Default | +|---------------------------------|-----------|------------------------------------------------------------------------------------------------------------------|---------| +| `GAME_COMMANDS_HYPIXEL_API_KEY` | str | Hypixel API key. | | +| `ENABLED_COMMANDS` | list[str] | Commands to enable. Defaults to all if left empty. | | +| `USE_ANTISPAM` | bool | Adds a random string of characters to the end of each message to try and evade spam filters. Usually not needed. | `false` | +| `COMMAND_COOLDOWN` | float | Cooldown between commands, in seconds. | `5.0` | + From b2af9e8cc0f70b70e78ac74913242224891a7e21 Mon Sep 17 00:00:00 2001 From: plun1331 Date: Tue, 5 May 2026 14:10:56 -0700 Subject: [PATCH 2/7] Update configuration instructions in README Removed configuration file instructions and updated to environment variable usage. --- README.md | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/README.md b/README.md index ba59d64..38769b1 100644 --- a/README.md +++ b/README.md @@ -80,12 +80,7 @@ Each bot will need its own service definition. ### Configuration -The bot can be configured using environment variables or a `config.json` file. -To use a file, mount it into the Docker container at `/Bot/config.json`. For example: -```yaml -volumes: - - ./config.json:/Bot/config.json -``` +The bot can be configured using environment variables. For all options, see [`config.md`](./config.md). ### Updating the Bot To update the bot to the latest version, run the following commands: From c00c88eade441b59cdb0f730b3be9b671e12e31f Mon Sep 17 00:00:00 2001 From: plun1331 Date: Tue, 5 May 2026 14:19:26 -0700 Subject: [PATCH 3/7] Delete config.md --- config.md | 67 ------------------------------------------------------- 1 file changed, 67 deletions(-) delete mode 100644 config.md diff --git a/config.md b/config.md deleted file mode 100644 index b734bfb..0000000 --- a/config.md +++ /dev/null @@ -1,67 +0,0 @@ -# Configuration - -## Server -| Key | Type | Description | Default | -|---------------|------|-------------------------------------|------------------| -| `SERVER_HOST` | str | The host to connect to. | `mc.hypixel.net` | -| `SERVER_PORT` | int | The port to connect to on the host. | `25565` | - -## Account -| Key | Type | Description | Default | -|-----------------|------|-------------------------------------------------------------------------------------|---------| -| `ACCOUNT_EMAIL` | str | Not actually useful, serves as an internal identifier for the account you're using. | | - -## Discord -| Key | Type | Description | Default | -|----------------------------------|-----------|----------------------------------------------------------------------------------------------------------------------------------------|---------| -| `DISCORD_TOKEN` | str | Discord bot token. | | -| `DISCORD_CHANNEL` | int | Channel ID for your bridge messages. | | -| `DISCORD_ALLOWCROSSCHAT` | list[int] | Channel IDs for which to allow "Cross Chat", which sends messages from other bridge bots to your guild. Formatted like so: `ID,ID,...` | | -| `DISCORD_OFFICERCHANNEL` | int | Channel ID for your officer chat messages. | | -| `DISCORD_ALLOWOFFICERCROSSCHAT` | list[int] | Same as `DISCORD_ALLOWCROSSCHAT`, but for officer chat. | | -| `DISCORD_COMMANDROLE` | int | Your "Guild Staff" role, allows members with the role to take staff actions with the bot (invite, kick, mute, etc.) | | -| `DISCORD_OVERRIDEROLE` | int | Your admin role, allows members with the role to use administrative commands such as `!override`. | | -| `DISCORD_OWNERID` | int | Functionally the same as `DISCORD_OVERRIDEROLE`, but for one user instead. | | -| `DISCORD_PREFIX` | str | The prefix for the bot. | `!` | -| `DISCORD_WEBHOOKURL` | str | If set, the bot will send webhook messages that appear to be from the Minecraft users, instead of embeds from the bot. | | -| `DISCORD_DEBUGWEBHOOKURL` | str | Outputs some of the bot's logs to this webhook. Not useful unless you know what you're doing. | | -| `DISCORD_SERVERNAME` | str | When using `DISCORD_WEBHOOKURL`, messages from the bridge bot will use this name as the webhook's name. | | -| `DISCORD_IGNORECROSSCHATWARNING` | bool | Silences the warning in the terminal when crosschat is enabled. | `false` - -## Settings -| Key | Type | Description | Default | -|-------------------------------|-----------|------------------------------------------------------------------------------------------------------------------------------|---------| -| `SETTINGS_AUTOACCEPT` | bool | Autoaccept guild invites. | `false` | -| `SETTINGS_DATELIMIT` | int | Date range limit for the `!top` command. Limited by Hypixel, so changing this value to something bigger will have no effect. | `30` | -| `SETTINGS_EXTENSIONS` | list[str] | List of `discord.py` extensions to load. There are two built-in: `.game_commands` and `.mute_sync`. | | -| `SETTINGS_PRINTCHAT` | bool | If enabled, prints all chat messages to the terminal. | `false` | -| `SETTINGS_HIDEINVITEMESSAGES` | bool | Hides invite messages from being sent to bridge chat. | `false` | - -## Redis -Optional and not useful unless you know what you're doing. -| Key | Type | Description | Default | -|------------------------|------|---------------------------------------------------|---------| -| `REDIS_HOST` | str | Hostname for the redis server. | | -| `REDIS_PORT` | int | Port for the redis server. | | -| `REDIS_PASSWORD` | str | Redis server password, if requirepass is enabled. | | -| `REDIS_CLIENTNAME` | str | Client name to use for pub/sub. | | -| `REDIS_RECEIVECHANNEL` | str | Pub/sub channel to receive messages on. | | -| `REDIS_SENDCHANNEL` | str | Pub/sub channel to send messages on. | | - -## Extensions -### `.mute_sync` -| Key | Type | Description | Default | -|------------------------------|------|------------------------------------|---------| -| `MUTE_SYNC_MUTE_ROLE` | int | The role to apply for guild mutes. | | -| `MUTE_SYNC_HYPIXEL_API_KEY` | str | Hypixel API key. | | -| `MUTE_SYNC_SKYKINGS_API_KEY` | str | SkyKings API key. | | - -### `.game_commands` -Uses `DISCORD_PREFIX` (see above) as the prefix for commands. -| Key | Type | Description | Default | -|---------------------------------|-----------|------------------------------------------------------------------------------------------------------------------|---------| -| `GAME_COMMANDS_HYPIXEL_API_KEY` | str | Hypixel API key. | | -| `ENABLED_COMMANDS` | list[str] | Commands to enable. Defaults to all if left empty. | | -| `USE_ANTISPAM` | bool | Adds a random string of characters to the end of each message to try and evade spam filters. Usually not needed. | `false` | -| `COMMAND_COOLDOWN` | float | Cooldown between commands, in seconds. | `5.0` | - From 94f8086ec674c3814810c441381f61c7661dc2e5 Mon Sep 17 00:00:00 2001 From: plun1331 Date: Tue, 5 May 2026 14:20:57 -0700 Subject: [PATCH 4/7] Update README.md --- README.md | 103 +----------------------------------------------------- 1 file changed, 1 insertion(+), 102 deletions(-) diff --git a/README.md b/README.md index 38769b1..d9316e4 100644 --- a/README.md +++ b/README.md @@ -22,108 +22,7 @@ and events, facilitating better communication and management. ## Installation and Usage -### Initial Setup - -Follow these instructions to start a new bridge bot instance: - -1. **Install Docker:** [Instructions Here](https://docs.docker.com/engine/install/#installation-procedures-for-supported-platforms) - -2. **Copy the Docker Compose File:** - ```bash - curl https://raw.githubusercontent.com/SkyKings-Network/GuildBridgeBot/refs/heads/main/compose.yml > compose.yml - ``` - -3. **Update the settings for your compose file as needed:** - ```bash - nano compose.yml - ``` - -4. **Start the Bot:** - ```bash - docker compose -f compose.yml up -d - ``` - -If you are running the bot for the first time, you will need to log in with a Minecraft account. -To do this, check the logs of the bot container to get the link to log in: -```bash -docker compose logs -n 50 -``` - -### Running multiple bridge bots -To run multiple bridge bots, you will need to add on to your docker compose file. -Each bot will need its own service definition. - -1. **Open your compose file:** - ```bash - nano compose.yml - ``` - -2. **Add a new service for each additional bot:** - ```yaml - bot2: - image: skykingsnetwork/guildbridgebot:latest - container_name: guildbridgebot2 - restart: unless-stopped - environment: - - BRIDGE_USE_ENV_CONFIG=true - - BRIDGE_ACCOUNT_EMAIL= - - BRIDGE_DISCORD_TOKEN= - - BRIDGE_DISCORD_CHANNEL= - ``` - -3. **Update the environment variables for each bot accordingly.** -4. **Save and exit the file.** -5. **Restart the docker compose setup:** - ```bash - docker compose -f compose.yml up -d - ``` - -### Configuration - -The bot can be configured using environment variables. For all options, see [`config.md`](./config.md). - -### Updating the Bot -To update the bot to the latest version, run the following commands: -```bash -docker compose -f compose.yml pull -docker compose -f compose.yml up -d -``` - -## Commands - -### Guild Management - -| Command | Description | -|---------|-------------| -| `!invite ` | Invite a player to the guild | -| `!kick [reason]` | Kick a player from the guild | -| `!promote ` | Promote a guild member | -| `!demote ` | Demote a guild member | -| `!setrank ` | Set a member's rank | -| `!mute ` | Mute a guild member | -| `!unmute ` | Unmute a guild member | - -### Communication Control - -| Command | Description | -|---------|-------------| -| `!notifications` | Toggle join/leave notifications | -| `!toggleaccept` | Toggle auto-accepting guild invites | - -### Miscellaneous - -| Command | Description | -|---------|-------------| -| `!help` | Display all available commands and bot information | -| `!online` | Check online guild members | -| `!list` | Show a list of all guild members | -| `!top` | Shows xperience ranking of members for the day | -| `!info` | Shows Guild Information | -| `!override ` | Force the bot to use a given command | - -Note: Some commands may require appropriate permissions in both Discord and the Hypixel guild. - ---- +**For installation, usage, and configuration, please read the wiki: https://github.com/SkyKings-Network/GuildBridgeBot/wiki** ## Troubleshooting From ea4f3f28fc615b62472b12e3a05ba67d81b0c3ce Mon Sep 17 00:00:00 2001 From: plun1331 Date: Tue, 5 May 2026 14:26:16 -0700 Subject: [PATCH 5/7] Create SECURITY.md --- SECURITY.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 SECURITY.md diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..6e8d82d --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,6 @@ +# Security Policy + +To report a security vulnerability, please create a private vulnerability report directly through the GitHub Security tab. + +For sensitive disclosures that cannot be reported via GitHub, contact us on Discord (@plun1331, ID 545064119326212106 through https://discord.gg/skykings) +with a clear description of the issue, reproduction steps, and impact. We aim to acknowledge all reports within 48 hours and work toward a remediation plan as quickly as possible. From 2129d0226f0a8c9f034f6bf2bc05efe0b6dc58f6 Mon Sep 17 00:00:00 2001 From: plun1331 Date: Tue, 5 May 2026 14:30:28 -0700 Subject: [PATCH 6/7] Update SECURITY.md --- SECURITY.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/SECURITY.md b/SECURITY.md index 6e8d82d..3eb40d0 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -1,6 +1,3 @@ # Security Policy -To report a security vulnerability, please create a private vulnerability report directly through the GitHub Security tab. - -For sensitive disclosures that cannot be reported via GitHub, contact us on Discord (@plun1331, ID 545064119326212106 through https://discord.gg/skykings) -with a clear description of the issue, reproduction steps, and impact. We aim to acknowledge all reports within 48 hours and work toward a remediation plan as quickly as possible. +To report a security vulnerability, open a ticket on our Discord server: https://discord.gg/skykings. From 377471d0ee88dc58094abd31dbdfd4b71a1b1949 Mon Sep 17 00:00:00 2001 From: plun1331 Date: Mon, 11 May 2026 13:19:22 -0700 Subject: [PATCH 7/7] fix: handle cases with no profiles in game commands Added checks for empty profiles in game_commands.py. --- extensions/game_commands/game_commands.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/extensions/game_commands/game_commands.py b/extensions/game_commands/game_commands.py index 94158a0..c6d37d8 100644 --- a/extensions/game_commands/game_commands.py +++ b/extensions/game_commands/game_commands.py @@ -198,6 +198,8 @@ async def level(self, name, args, *, officer: bool = False, head: str = None): if not data["success"]: return await chat_msg(f"Failed to get {player}'s profile.") profiles = data["profiles"] + if not profiles: + return await chat_msg(f"{player} has no profiles.") if profile is None: profile = [p for p in profiles if p.get("selected")] if not profile: @@ -236,6 +238,8 @@ async def slayers(self, name, args, *, officer: bool = False, head: str = None): if not data["success"]: return await chat_msg(f"Failed to get {player}'s profile.") profiles = data["profiles"] + if not profiles: + return await chat_msg(f"{player} has no profiles.") if profile is None: profile = [p for p in profiles if p.get("selected")] if not profile: