Skip to content

Commit

Permalink
Docs and more renaming to Discord Bridge
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyenquyhy committed Aug 15, 2016
1 parent b147bba commit 829f167
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 14 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# CHANGE LOG

## 1.3.1
- Auto re-login for expired sessions on receiving new messages
- Clean up error log

## 1.3.0
- Rename to Discord Bridge
- Update Discord4J
- Escape player with underscore in their name

## 1.1.1
- Update due to changes in Discord API.

Expand Down
14 changes: 10 additions & 4 deletions GETTING STARTED.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,21 @@

## How to setup for servers
1. Setup a Minecraft server with compatible [SpongeVanilla](https://docs.spongepowered.org/en/server/getting-started/implementations/spongevanilla.html) or [SpongeForge](https://docs.spongepowered.org/en/server/getting-started/implementations/spongeforge.html)
1. Download Sponge Discord [latest release](https://github.com/nguyenquyhy/Sponge-Discord/releases) and put it in your server's mod folder
1. Start the server to create a default config file at `configs/spongediscord/config.conf`
1. Download Discord Bridge [latest release](https://github.com/nguyenquyhy/Sponge-Discord/releases) and put it in your server's mod folder
1. Start the server to create a default config file at `configs/com.nguyenquyhy.spongediscord/config.conf`
1. Set compulsory values in the newly created config file
- `Channel`: the ID of your Discord channel. Check our
[README.md](README.md) if you don't know how to obtain it.
- `InviteCode`: the invitation code to the channel above. You should also remove the expiring time of the code.
1. Restart the server or run `/discord reload`
1. Setup default/bot account (this is optional, but necessary if you want all players in your server able to send/receive Discord messages)
- Go to https://discordapp.com/developers to create a new Discord Applications and App Bot User
- Add the Bot to your channel https://discordapp.com/developers/docs/topics/oauth2#bots
- Set the Bot's Token in Discord Bridge config

Legacy bot account setup (not recommended):
- Run `/discord default login <bot_Discord_username> <bot_Discord_password>`
- Sponge-Discord will automatically re-login the default/bot account if your server restarts.
- Discord Bridge will automatically re-login the default/bot account if your server restarts.

## How to use for players
- You can chat in Discord in the specific channel above
Expand All @@ -21,4 +26,5 @@
- Your messages will show up in the Discord channel under your Discord name if you have __authenticated__.
- Your messages will show up in the Discord channel under the bot name if you have not __authenticated__ and server owner has set up a default/bot account.
- Otherwise, your messages from Minecraft will not be sent to Discord.
- To __authenticate__, run this command in Minecraft `/discord login <your_Discord_username> <your_Discord_password>`
- To __authenticate__, run this command in Minecraft `/discord login <your_Discord_username> <your_Discord_password>`
- **WARNING: some server logs all command, so be careful not to leak your Discord credentials on untrusted servers.**
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,24 @@ Build **Sponge-Discord**

- `/discord login <email> <password>`: login to Discord and bind the Discord account to the Minecraft account for automatic login in the future. The email and password will not be stored; instead, the access token of the user will be stored in the config folder on the server.
- `/discord logout`: logout of Discord and unbind the Discord account from the Minecraft account.
- `/discord default login <email> <password>`: login to a default Discord account. This account will be used as a bot for unauthenticated players to send and receive Discord messsages in Minecraft.
- `/discord default logout`: logout of the default Discord account.
- `/discord broadcast`: as this plugin cannot capture server's `/say` at the moment, this command is to send a message to all online players and Discord. This command requires having the default account set up.
- `/discord reload`: reload configurations.

The below commands are still working but not recommended. Use a bot account instead.

- `/discord default login <email> <password>`: login to a default Discord account. This account will be used as a bot for unauthenticated players to send and receive Discord messsages in Minecraft.
- `/discord default logout`: logout of the default Discord account.

A short summary is below:

| Command | Shorthand | Permission |
|---------|-----------|------------|
| `/discord login <e> <p>` | `/d l <e> <p>` | &nbsp; |
| `/discord logout` | `/d lo` | &nbsp; |
| `/discord default login <e> <p>` | `/d d l <e> <p>` | `spongediscord.default` |
| `/discord default logout` | `/d d lo` | `spongediscord.default` |
| `/discord broadcast <message>` | `/d b <message>` | `spongediscord.broadcast` |
| `/discord reload` | `/d reload` | `spongediscord.reload` |
| `/discord default login <e> <p>` | `/d d l <e> <p>` | `spongediscord.default` |
| `/discord default logout` | `/d d lo` | `spongediscord.default` |

Some ideas for future commands

Expand Down Expand Up @@ -77,4 +80,5 @@ Some ideas for future commands

## TODO

- [ ] Group-based prefix
- [ ] Group-based prefix
- [ ] URL from Discord should be clickable in Minecraft.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public static void register() {

CommandSpec reloadCmd = CommandSpec.builder()
.permission("spongediscord.reload")
.description(Text.of("Reload Sponge Discord configuration"))
.description(Text.of("Reload Discord Bridge configuration"))
.executor(new ReloadCommand())
.build();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public static void loadConfiguration(Config config) {

if (!Files.exists(configFile)) {
Files.createFile(configFile);
logger.info("[Sponge-Discord]: Created default configuration, ConfigDatabase will not run until you have edited this file!");
logger.info("Created default configuration, ConfigDatabase will not run until you have edited this file!");
}
configNode = configLoader.load();

Expand Down Expand Up @@ -76,8 +76,7 @@ public static void loadConfiguration(Config config) {
}
logger.info("Configuration loaded. Channel " + config.CHANNEL_ID);
} catch (IOException e) {
logger.error("[Sponge-Discord]: Couldn't create default configuration file!", e);
logger.error("Couldn't create default configuration file!", e);
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ public void handle(ReadyEvent readyEvent) {
logger.error("Cannot handle ReadyEvent! " + e.getLocalizedMessage(), e);
} catch (MissingPermissionsException e) {
if (e.getMissingPermission().contains(Permissions.SEND_MESSAGES)) {
logger.error("Sponge-Discord cannot send messages to the preset channel!");
logger.error("Discord Bridge cannot send messages to the preset channel!");
} else {
logger.error(e.getErrorMessage(), e);
}
Expand Down

0 comments on commit 829f167

Please sign in to comment.