Skip to content
This repository was archived by the owner on May 6, 2023. It is now read-only.

Commit 09f4cc8

Browse files
committed
Updated documentation
1 parent 0d51366 commit 09f4cc8

10 files changed

+432
-10
lines changed

README.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,22 @@ SCPDiscord links features from your SCP:SL server console to Discord channels, s
1010

1111
* Support for MultiAdmin managed servers, each sub-server can post to the same channel, different channels or even different bots and different Discord servers.
1212

13-
* You can for instance have one public channel for each of your servers where things like player joins, kills, round starts and round ends are posted. You could then add one channel for each server visible only to moderators, showing things like admin actions and logging who attacks who on each server to check for teamkillers.
13+
* You can for instance have one public channel for each of your servers where things like player joins, kills, round starts and round ends are posted.
14+
You could then add one channel for each server visible only to moderators, showing things like admin actions and logging who attacks who on each server to check for teamkillers.
1415

15-
* Ability to use different commands through Discord, currently kick, ban and unban. To my knowledge this is the only plugin that currently offers banning offline players, so hackers leaving as soon as they see an admin coming on is no longer an issue. It is also the only plugin I'm aware of that lets you unban players.
16+
* Ability to use different commands through Discord, currently kick, ban and unban. To my knowledge this is the only plugin that currently offers banning offline players, so hackers leaving as soon as they see an admin coming on is no longer an issue.
17+
It is also the only plugin I'm aware of that lets you unban players.
1618

17-
* The ability to completely customise every single message from the plugin and use different languages. More info [here](https://github.com/KarlOfDuty/SCPDiscord/wiki/Languages).
19+
* The ability to completely customise every single message from the plugin and use different languages. More info [here](docs/Languages.md).
1820

1921
* Player count is displayed in the bot activity field. The bot's status changes from dnd when the scp server is off but the bot server is on, away when there are no players on a server and online when a server has players.
2022

21-
* You can sync ranks from discord to the game, letting you automate things like patreon rewards and moderator positions.
23+
* You can sync ranks from discord to the game, letting you automate things like supporter rewards and moderator positions.
2224

23-
## Installation and configuration
25+
## Guides
2426

25-
Check out the [Wiki tab](https://github.com/KarlOfDuty/SCPDiscord/wiki) for all guides on installation and configs.
27+
[Installation](docs/Installation.md)
2628

27-
## Usage
29+
[Editing messages and languages](docs/Languages.md)
2830

29-
[Languages](https://github.com/KarlOfDuty/SCPDiscord/wiki/Languages)
30-
31-
[Commands and Permissions](https://github.com/KarlOfDuty/SCPDiscord/wiki/Commands-and-Permissions)
31+
[Commands and permissions](docs/CommandsAndPermissions.md)

docs/CommandsAndPermissions.md

+226
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,226 @@
1+
# Bot commands
2+
3+
## Time
4+
5+
Time is expressed in the format NumberUnit where unit is a unit of time and number is the amount of that time unit, for example 6M represents six months.
6+
7+
Valid time units:
8+
9+
| Letter | Unit |
10+
|:---------:|:---------:|
11+
| `s` | Seconds |
12+
| `m` | Minutes |
13+
| `h` | Hours |
14+
| `d` | Days |
15+
| `w` | Weeks |
16+
| `M` | Months |
17+
| `y` | Years |
18+
19+
---
20+
21+
22+
23+
### Ban
24+
25+
**Command usage:**
26+
27+
`ban <steamid> <duration> (reason)` - Bans a player from the server.
28+
29+
**Variables:**
30+
31+
* `<steamid>` - The SteamID of the player to be banned.
32+
33+
* `<duration>` - The duration of the ban, time formatting info above.
34+
35+
* `(reason)` - Optional reason for the ban.
36+
37+
Example: `+ban 76561138022363616 4d Bad man.` Bans the player for four days with the reason "Bad man."
38+
39+
---
40+
41+
### Unban
42+
43+
**Command usage:**
44+
45+
`unban <steamid/ip>` - Unbans a player from the server.
46+
47+
**Variables:**
48+
49+
* `<steamid/ip>` - The SteamID or IP of the player to be unbanned.
50+
51+
---
52+
53+
### Kick
54+
55+
**Command usage:**
56+
57+
`kick <steamid> (reason)` - Kicks a player from the server.
58+
59+
**Variables:**
60+
61+
* `<steamid>` - The SteamID of the player to be kicked.
62+
* `(reason)` - Optional reason for the kick.
63+
64+
---
65+
66+
### Kickall
67+
68+
**Command usage:**
69+
70+
`kickall (reason)` - Kicks all players from the server with a message, useful for server shutdowns.
71+
72+
**Variables:**
73+
74+
* `(reason)` - Reason to be displayed to all players kicked.
75+
76+
---
77+
78+
### List
79+
80+
**Command usage:**
81+
82+
`list` - Lists all online players.
83+
84+
---
85+
86+
### Syncsteamid
87+
88+
**Command usage:**
89+
90+
`syncsteamid <steamid>` - Syncs your discord role to the game.
91+
92+
**Variables:**
93+
94+
* `<steamid>` - The SteamID of your account.
95+
96+
---
97+
98+
### Syncip
99+
100+
**Command usage:**
101+
102+
`syncip <ip>` - Syncs your discord role to the game. (For servers not using steam)
103+
104+
**Variables:**
105+
106+
* `<ip>` - Your ip address.
107+
108+
---
109+
### Unsyncrole
110+
111+
**Command usage:**
112+
113+
`unsyncrole` - Removes the steam account from being synced with your discord account.
114+
115+
---
116+
117+
118+
### Any other console commands
119+
120+
**Command usage:**
121+
122+
Enter the console command starting with your command prefix and `server`.
123+
124+
Example with command prefix `+`: `+server roundrestart`.
125+
126+
---
127+
128+
# Plugin console commands
129+
130+
### Reload
131+
132+
**Command usage:**
133+
134+
`scpd_reload` - Reloads the plugin, all configs and files and reconnects.
135+
136+
---
137+
138+
### Reconnect
139+
140+
**Command usage:**
141+
142+
`scpd_reconnect, scpd_rc` - Reconnects to the bot.
143+
144+
---
145+
146+
### Unsync
147+
148+
**Command usage:**
149+
150+
`scpd_unsync <discordid>` - Manually remove a player from being synced to discord.
151+
152+
**Variables:**
153+
154+
* `<discordid>` - The Discord user ID of the player to be removed.
155+
156+
---
157+
158+
### GrantVanillaRank
159+
160+
**Command usage:**
161+
162+
`scpd_grantvanillarank/scpd_gvr <steamid/playerid> <rank>` - Gives a player a vanilla rank for their current session.
163+
164+
**Variables:**
165+
166+
* `<steamid/playerid>` - Either the steamid or playerid of the player to grant a rank.
167+
* `<rank>` - The name of the rank as defined in the vanilla config.
168+
169+
---
170+
171+
### GrantReservedSlot
172+
173+
**Command usage:**
174+
175+
`scpd_grantreservedslot/scpd_grs <steamid>` - Gives a player a reserved slot on the server.
176+
177+
**Variables:**
178+
179+
* `<steamid>` - The steamid of the player to add.
180+
181+
---
182+
183+
### RemoveReservedSlot
184+
185+
**Command usage:**
186+
187+
`scpd_removereservedslot/scpd_rrs <steamid>` - Removes a reserved slot from a player.
188+
189+
**Variables:**
190+
191+
* `<steamid>` - The steamid of the player to be removed.
192+
193+
---
194+
195+
### Validate
196+
197+
**Command usage:**
198+
199+
`scpd_validate` - Creates a config and language validation report in the console.
200+
201+
---
202+
203+
### SetNickname
204+
205+
**Command usage:**
206+
207+
`scpd_setnickname <player id/steamid> <nickname>` - Sets a player's nickname, useful for the rolesync system if you want to sync discord names.
208+
209+
---
210+
211+
# Permissions
212+
213+
(These only apply when using server commands via remote admin, not through discord)
214+
215+
| Permission | Description |
216+
|---------------------------------|----------------------------------------------------------------------------------|
217+
| `scpdiscord.reload` | Allows a player to reload the plugin. |
218+
| `scpdiscord.reconnect` | Allows a player to reconnect the plugin to the bot. |
219+
| `scpdiscord.unsync` | Allows a player to unsync other players from discord. |
220+
| `scpdiscord.verbose` | Allows a player to toggle the verbose setting. |
221+
| `scpdiscord.debug` | Allows a player to toggle the debug setting. |
222+
| `scpdiscord.grantreservedslot` | Allows a player to grant reserved slots. |
223+
| `scpdiscord.removereservedslot` | Allows a player to remove reserved slots. |
224+
| `scpdiscord.grantvanillarank` | Allows a player to grant vanilla ranks. |
225+
| `scpdiscord.validate` | Allows a player to print a config and language validation report in the console. |
226+
| `scpdiscord.setnickname` | Allows a player to set someones nickname. |

docs/CreateBot.md

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Creating a bot application
2+
3+
1. [Open the Discord developer portal](https://discord.com/developers/applications).
4+
2. Create a new application in the top right corner.
5+
3. Click add bot in the bot tab.
6+
4. Turn off public status in the bot tab:
7+
8+
![Image showing a Discord selection box](img/botPublic.png)
9+
10+
5. Turn on all intents in the bot tab:
11+
12+
![Image showing a Discord selection box](img/botPage.png)
13+
14+
4. Generate an invite link in the OAuth2 tab with the following scopes (bot permissions do not matter in this step):
15+
16+
![Image showing a Discord selection box](img/botScopes.png)
17+
18+
6. Invite the bot using the invite link generated at the bottom.

docs/Installation.md

+115
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
# Important information, read this first
2+
3+
----
4+
5+
**If you have download the bot directly from the repo** rather than from the releases tab or dev builds you have to make a copy of `default_config.yml` and name it `config.yml`.
6+
7+
This is to make sure I or anyone else who adds to this bot don't accidentally post their bot token or other sensitive information in the public repository.
8+
9+
----
10+
11+
**SECURITY WARNING:**
12+
13+
**The bot has no authorization of incoming connections**, this means you cannot allow the plugin's port through your firewall or anyone will be able to send fake messages to it.
14+
15+
If you really need to run the SCP:SL server on one system and the bot on another connected over the internet you can try this:
16+
17+
```bash
18+
sudo ufw allow from 111.111.111.111 to any port 8888
19+
```
20+
21+
This allows only the IP 111.111.111.111 to connect to the bot on port 8888 as long as your default setting is to deny all (which it is by default).
22+
23+
----
24+
25+
**SECURITY WARNING:**
26+
27+
If you ever reveal the bot token to anyone or post it somewhere where it can be read from the internet you need to reset it immediately.
28+
It gives others full access to the bot's Discord account so they can use it to do whatever they want with your Discord server, including deleting it.
29+
30+
It is also highly recommended to make sure the bot only has the necessary Discord permissions and no more in order to limit the damage if you accidentally post your bot token somewhere.
31+
32+
----
33+
34+
# Installation
35+
36+
----
37+
38+
## 1. Download
39+
40+
Download the SCPDiscord archive, either a [release](https://github.com/KarlOfDuty/SCPDiscord/releases) or [dev build](https://jenkins.karlofduty.com/blue/organizations/jenkins/CI%2FSCPDiscord/activity/).
41+
42+
### **Bot:**
43+
44+
Extract the bot anywhere you wish outside of the server directory.
45+
46+
### **Plugin:**
47+
48+
Extract the plugin and dependencies directory into the `<server_dir>/sm_plugins` directory:
49+
```
50+
sm_plugins/
51+
dependencies/
52+
Google.Protobuf.dll
53+
Newtonsoft.Json.dll
54+
YamlDotNet.dll
55+
SCPDiscord.dll
56+
```
57+
58+
----
59+
60+
## 2. Server config
61+
62+
This plugin does not use the server config for configuration like most others, instead it has it's own plugin config in your config directory.
63+
64+
The only thing configured in the server config is where to place the plugin's files:
65+
66+
| Name (in config_gameplay.txt) | Default value | Description |
67+
|-------------------------------|:-------------:|----------------------------------------------------------------------------------------------------------|
68+
| `scpdiscord_config_global` | `true` | Decides whether to place the plugin config in the global config directory instead of the local one. |
69+
| `scpdiscord_rolesync_global` | `true` | Decides whether to place the rolesync data in the global config directory instead of the local one. |
70+
| `scpdiscord_languages_global` | `true` | Decides whether to place the language directory in the global config directory instead of the local one. |
71+
72+
Depending on how you have set up your server the local config directory should be in `<server_dir>/servers/servername/` for multiadmin servers or `~/config/SCP Secret Laboratory/config/<server_port>/` for localadmin servers and multiadmin servers if you do not create the local server directory.
73+
74+
The global config directory is most likely in `~/config/SCP Secret Laboratory` on linux or `%Appdata%/SCP Secret Laboratory` on windows.
75+
76+
The plugin config is automatically created for you the first time you run the plugin. The path is printed in the server console on startup so you know for sure where it is.
77+
78+
----
79+
80+
## 3. Plugin config
81+
82+
[Click here to view default config](https://github.com/KarlOfDuty/SCPDiscord/blob/master/SCPDiscordPlugin/config.yml)
83+
84+
Remember to set the bot port to something **different from the scpsl server port**, or everything will break.
85+
86+
Remember this port as you will need to put it in the bot config too.
87+
88+
**Note:** Keeping the bot and plugin on different devices is not supported but is possible, you will have to deal with the issues this may result in yourself if you choose to do so.
89+
Simply change the bot ip in the config below to correspond with the other device.
90+
91+
----
92+
93+
## 4. Bot setup and config:
94+
95+
### Bot setup:
96+
97+
Set up your bot in the discord control panel according to the guide [here](CreateBot.md).
98+
99+
### Config setup:
100+
101+
[Click here to view default config](https://github.com/KarlOfDuty/SCPDiscord/blob/master/SCPDiscordBot/default_config.yml)
102+
103+
The different options are described in the config. Get Discord IDs by turning on developer mode in Discord and right clicking on a server, role or user.
104+
105+
Run the bot using:
106+
```yaml
107+
# Linux:
108+
./SCPDiscordBot
109+
# Windows
110+
./SCPDiscordBot.exe
111+
```
112+
113+
----
114+
115+
### If you have followed all the steps you should now have a working Discord bot, otherwise contact me in Discord.

0 commit comments

Comments
 (0)