-
Notifications
You must be signed in to change notification settings - Fork 16
Docker Installation
Tag | Description |
---|---|
latest | Latest stable releases |
dev | May be unstable and contain unfinished features |
There are two ways to deploy bots with Docker.
- Create
docker-compose.yml
file - Copy into the file
version: "3.7"
services:
discord-bot:
image: specker/discordplayercountbot
environment:
BOT_NAMES: "Bot1;Bot2"
BOT_PUBADDRESSES: "127.0.0.1;127.0.0.1"
BOT_PORTS: "16261;16262"
BOT_DISCORD_TOKENS: "DiscordToken1;DiscordToken2"
BOT_UPDATE_TIME: "30"
BOT_STATUSES: "1;2"
BOT_USENAMETAGS: "false;false"
BOT_PROVIDERTYPES: "0;0"
BOT_APPLICATION_VARIABLES: "SteamAPIKey,Here;BattleMetricsKey,Here"
- Edit variables and save the File
- Open terminal in a location of
docker-compose.yml
file and typedocker-compose up
- Press Enter
- Open Terminal
- Type:
docker run \
--name=PlayerCounterDiscordBot \
-e BOT_NAMES='Bot1;Bot2' \
-e BOT_PUBADDRESSES='127.0.0.1;127.0.0.1' \
-e BOT_PORTS='16261;16262' \
-e BOT_DISCORD_TOKENS='DiscordToken1;DiscordToken2' \
-e BOT_UPDATE_TIME='30' \
-e BOT_STATUSES='1;2' \
-e BOT_PROVIDERTYPES='0;0' \
-e BOT_USENAMETAGS='false;false' \
-e BOT_APPLICATION_VARIABLES='SteamAPIKey,Here;BattleMetricsKey,Here' \
specker/discordplayercountbot
- Edit values in single quotes and press enter
Container images are configured with help of those variables.
Variable | Function |
---|---|
BOT_NAMES |
Names of bots |
BOT_PUBADDRESSES |
Addresses of gameservers |
BOT_PORTS |
Query ports of gameservers |
BOT_DISCORD_TOKENS |
Discord Bots tokens |
BOT_STATUSES |
Discord Bots statuses |
BOT_STATUSFORMATS |
Discord Bots status formats |
BOT_USENAMETAGS |
"Uses name variable as a prefixed status label" |
BOT_PROVIDERTYPES |
Who provides the data for the bot. |
BOT_UPDATE_TIME |
How often bot should refresh |
BOT_APPLICATION_VARIABLES |
Application Variables for all bots |
To declare Multiple bots in docker separate values in BOT_NAMES
, BOT_PUBADDRESSES
, BOT_PORTS
, BOT_DISCORD_TOKENS
, BOT_STATUSES
, BOT_PROVIDERTYPES
, and BOT_USENAMETAGS
with ;
One bot:
BOT_NAMES='Bot1'
Two bots:
BOT_NAMES='Bot1;Bot2'
BOT_APPLICATION_VARIABLES
is a key value pair. The key and value are seperated by commas, and each pair is seperated by a semi-colon.
Example:
BOT_APPLICATION_VARIABLES='SteamAPIKey,34124124123rfwer1424124124;BattleMetricsKey,24124124124rwefwrgery5323423412312'
For a single key-value pair, you do NOT need to use a semi-colon seperator.
Example:
BOT_APPLICATION_VARIABLES='SteamAPIKey,34124124123rfwer1424124124'
For an instance where you do not require any tokens for the bot, remove the lin that states: BOT_APPLICATION_VARIABLES
Please note: This is an example of format without data not specific data, so provider types, address, and more may not be correct.
Name | Value |
---|---|
SteamAPIKey | Your API Key from here. |
BattleMetricsKey | Your API Key from here. |
version: "3.7"
services:
discord-bot:
image: specker/discordplayercountbot
environment:
BOT_NAMES: "Bot1;Bot2"
BOT_PUBADDRESSES: "127.0.0.1;127.0.0.1"
BOT_PORTS: "16261;16262"
BOT_DISCORD_TOKENS: "DiscordToken1;DiscordToken2"
BOT_UPDATE_TIME: "30"
BOT_STATUSES: "1;2"
BOT_USENAMETAGS: "false;false"
BOT_PROVIDERTYPES: "0;0"
BOT_APPLICATION_VARIABLES: "SteamAPIKey,Here;BattleMetricsKey,Here"
version: "3.7"
services:
discord-bot:
image: specker/discordplayercountbot
environment:
BOT_NAMES: "Bot1;Bot2"
BOT_PUBADDRESSES: "127.0.0.1;127.0.0.1"
BOT_PORTS: "16261;16262"
BOT_DISCORD_TOKENS: "DiscordToken1;DiscordToken2"
BOT_UPDATE_TIME: "30"
BOT_STATUSES: "1;2"
BOT_USENAMETAGS: "false;false"
BOT_PROVIDERTYPES: "0;0"
BOT_APPLICATION_VARIABLES: "SteamAPIKey,Here"
Without Steam:
version: "3.7"
services:
discord-bot:
image: specker/discordplayercountbot
environment:
BOT_NAMES: "Bot1;Bot2"
BOT_PUBADDRESSES: "127.0.0.1;127.0.0.1"
BOT_PORTS: "16261;16262"
BOT_DISCORD_TOKENS: "DiscordToken1;DiscordToken2"
BOT_UPDATE_TIME: "30"
BOT_STATUSES: "1;2"
BOT_USENAMETAGS: "false;false"
BOT_PROVIDERTYPES: "0;0"
BOT_APPLICATION_VARIABLES: "BattleMetricsKey,Here"
Without Steam and Battle Metrics
version: "3.7"
services:
discord-bot:
image: specker/discordplayercountbot
environment:
BOT_NAMES: "Bot1;Bot2"
BOT_PUBADDRESSES: "127.0.0.1;127.0.0.1"
BOT_PORTS: "16261;16262"
BOT_DISCORD_TOKENS: "DiscordToken1;DiscordToken2"
BOT_UPDATE_TIME: "30"
BOT_STATUSES: "1;2"
BOT_USENAMETAGS: "false;false"
BOT_PROVIDERTYPES: "0;0"