Reviewed-on: https://gitea.filterhome.xyz/ofilter/Steam_Invite_Discord/pulls/45
Steam Player Lobby Discord Bot
Description
Discord bot that posts your Steam lobbies for others to join.
Invite the bot
Use the following link to invite the "official" bot.
If you want to test/try/invite the development/testing bot, use this other link:
FAQ
- Do I need to set an email or password/token from my Steam account or Log In on any way?
No.
The bot will only use and store "vanity URL".
If you receive a message requesting further data than the vanity URL, please contact the bot administrator as there could have been a security breach.
- If I change my steam name will I need to relink my account?
No.
When you link the account, it obtains and stores your Steam ID instead of your Steam Name, therefore unless you desire to link a different steam account, there is no need to relink it.
- Which information does this bot store from the users?
It only stores:
Steam vanity url and the ID from the user who submitted such account.
- Is
Shlink
related variables obligatory/required if I don't want to set up the link shortener functionality?
No, you can ignore them.
If any from the both variables (SHLINK_SERVER_URL
and SHLINK_TOKEN
) is unset, the functionality won't be enabled.
- Why
God
instead ofOwner
orBotAdmin
something like that?
I think it's more funny that way.
Docker image
Docker image is located here:
Note:
Image tags/versions don't match the bot versions. Recommended to always use thelatest
tag to get the latest version.
How to run
Note:
After generating the bot that will be used, theMessage Content Intent
field on the Discord developer page needs to be enabled.
Note:
Hosting a Shlink server will not be covered.
docker-compose
Clone the repo
git clone https://gitea.filterhome.xyz/ofilter/Steam_Invite_Discord
Cloning into 'Steam_Invite_Discord'...
remote: Enumerating objects: 771, done.
remote: Counting objects: 100% (771/771), done.
remote: Compressing objects: 100% (767/767), done.
remote: Total 771 (delta 519), reused 0 (delta 0), pack-reused 0
Receiving objects: 100% (771/771), 1.51 MiB | 7.52 MiB/s, done.
Resolving deltas: 100% (519/519), done.
Set ENV vars
Modify the file docker-compose.yaml
and set (at least) the environment variables STEAM_TOKEN and DISCORD_TOKEN for a basic usage.
Username and password are heavily recommended to be changed.
Note:
The provideddocker-compose.yaml
file is not expected to comply with any security standard, but to provide a usable configuration reference.
Run
docker compose up
➜ Steam_Invite_Discord git:(master) ✗ docker-compose up [+] Running 11/11 ✔ steam_invite_discord_bot 10 layers [⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿] 0B/0B Pulled 14.2s ✔ 661ff4d9561e Already exists 0.0s ✔ 44cda88cd45d Pull complete 0.7s ✔ 2cbca0db7eef Pull complete 0.7s ✔ 5c03c2d36281 Pull complete 0.4s ✔ b7fa17f943fb Pull complete 0.9s ✔ 901e8b243d94 Pull complete 5.9s ✔ 13f45f3b068a Pull complete 1.1s ✔ 717e63635303 Pull complete 2.0s ✔ e7ebdb3fa36f Pull complete 1.7s ✔ bdf104ac998a Pull complete 2.4s [+] Running 2/2 ✔ Container steam_invite_db Recreated 0.3s ✔ Container steam_invite_discord_bot Recreated 0.1s Attaching to steam_invite_db, steam_invite_discord_bot steam_invite_db | steam_invite_db | PostgreSQL Database directory appears to contain a database; Skipping initialization steam_invite_db | steam_invite_db | 2023-12-27 00:09:23.257 UTC [1] LOG: starting PostgreSQL 16.1 (Debian 16.1-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit steam_invite_db | 2023-12-27 00:09:23.257 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432 steam_invite_db | 2023-12-27 00:09:23.257 UTC [1] LOG: listening on IPv6 address "::", port 5432 steam_invite_db | 2023-12-27 00:09:23.268 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432" steam_invite_db | 2023-12-27 00:09:23.279 UTC [28] LOG: database system was shut down at 2023-12-27 00:09:22 UTC steam_invite_db | 2023-12-27 00:09:23.286 UTC [1] LOG: database system is ready to accept connections steam_invite_discord_bot | Connected! steam_invite_discord_bot | ------ steam_invite_discord_bot | Logged as steam_invite_discord_bot | MyTestingBot steam_invite_discord_bot | XXXXXXXXXXXXXXXXXX steam_invite_discord_bot | invite me with: https://discord.com/oauth2/authorize?client_id=XXXXXXXXXXXXXXXX&permissions=84032&scope=bot steam_invite_discord_bot | ------
Configuration
Environments
Environment | Default Value | Description |
---|---|---|
STEAM_TOKEN | <Null> | Steam API token. |
DISCORD_TOKEN | <Null> | Discord bot token. |
DISCORD_PREFIX | s. | Prefix for the discord bot to read the commands. |
DISCORD_ACTIVITY | Use {bot_prefix}help to get a list from all the available commands | Activity message displayed on the bot. Highly recommended to specify which is the prefix command to use the bot. |
DB_HOST | 127.0.0.1 | Hostname/IP to connect to the database server/container. |
DB_PORT | 5432 | Port used to authenticate to the database server. |
DB_USERNAME | <Null> | Username used to authenticate to the database server. |
DB_PASSWORD | <Null> | Password used to authenticate to the database server. |
DB_DATABASE | steam_invite | Database used to connect |
SHLINK_SERVER_URL | <Null> | Api key from a Shlink server. Not required. If both SHLINK_SERVER_URL and SHLINK_TOKEN are configured, it will be automatically enabled. |
SHLINK_TOKEN | <Null> | URL for the Shlink API server/service. Not required. If both SHLINK_SERVER_URL and SHLINK_TOKEN are configured, it will be automatically enabled. |
GOD_DISCORD_ID | <Null> | Used for certain special commands and stuff. Aka Discord Account ID for the admin of this bot. |
HEALTHCHECK_PORT | 8080 | On which port you wanna run the healthcheck. |
Shlink
Shlink is a self-hosted link shortener service.
https://shlink.io/documentation/api-docs/
Needless to say that this project is not associated nor correlated nor whatever, I chose that service out of my own convenience.
Using a Shlink server might be more advanced than a "minimal setup".
As per the moment only API v3 is supported.
Healthcheck
Healthcheck path is /healthz
Port is 8080
by DEFAULT, you can select yours by setting an environment variable named HEALTHCHECK_PORT
.
What returns
Note:
The status code from the request will match the numeric value specified on the server reply.
The healthcheck web server will return a Json as the following:
{"status_code": 200}
The status code can be 200
or 503
.
Proxy
Regarding running this bot behind a proxied/restricted network.
Discord
This seems relevant, I didn't test.
-
https://discord.com/developers/docs/topics/gateway#connections
-
https://discord.com/developers/docs/reference#api-reference-base-url