Request a cs:go players current live match via Discord bot.
WARNING: THIS PROJECT IS NOT OPERATIONAL |
---|
Valve has removed the ability to request a user's live match. For this reason, the project does not work in its current state because there is no way to get live match data anymore! See this or this issue for updates on this topic.
Currently, the bot allows only one operation at a time and logs in and out of Steam for every single request. A much better approach would be logging into Steam once and just refreshing the game coordinator connection if needed.
This is an old project requested by a customer and the code was written relatively quickly and is pretty bad in some places.
I made this project public because I had the code just lying around.
In order to use this script, you need the following dependencies and tokens:
- Node.js: https://nodejs.org/en/
- Compatible with Version 12 and 13
- Unused Steam account that will be used to check live games
- Steam API Key: https://steamcommunity.com/dev/apikey
- Discord Bot Token: https://discordapp.com/developers/applications
- Discord Channel ID: Retrieve your Discord Channel ID
- None
- Make sure you have the latest version of Node.js installed.
- Download this repository as ZIP and unpack it wherever you like.
- Go into the
configs
folder and renameconfig.json.example
toconfig.json
- Edit
config.json
and fill in your Steam API Key, Discord Bot Token and Discord Channel ID - Type
npm install
into your console of choice to install all necessary Node.js dependencies - Type
npm start
ornode server.js
to start the script.- To find out how to run the script permanently on a server you should check out forever.
Make sure you have everything set up properly and your config is valid without missing information!
In most cases, files only need to be overwritten, renamed or moved, but this project has no guaranteed backward compatibility and if the file structure changes during an update, a local installation must be manually adjusted. The only files that will remain compatible at all times are database files if not otherwise stated.
{
"Discord": {
"botToken": "DISCORD BOT TOKEN",
"botChannel": "DISCORD CHANNEL ID",
"botPrefix": "!",
"botCommand": "check",
"accessRole": ""
},
"Steam": {
"username": "STEAM USERNAME",
"password": "STEAM PASSWORD",
"sharedSecret": "STEAM ACCOUNT SECRET",
"apiKey": "STEAM API KEY"
},
"Customization": {
"tTag": "🔴",
"ctTag": "🔵"
}
}
accessRole
is optional. If empty, everybody is allowed to use commands.
- Use
!check <steamID64|profileURL>
to check live games for a specific Steam user- Examples:
!check 12345678912345678
!check http://steamcommunity.com/profiles/12345678912345678
!check https://steamcommunity.com/id/customURL
- Examples:
To get the steamID64 or URL of a profile you can use websites like STEAMID I/O.
In order to retrieve a unique Discord Channel ID, do as follows:
- Open your Discord Settings and click on the Appearance tab.
- In this tab, enable
Developer Mode
. - Go into your Discord Server and right-click the channel to copy its id.
- The context menu item will not be visible if Developer Mode is disabled.
There are currently no contributing guidelines, but I am open to any kind of improvements.
In order to contribute to the project, please follow the GitHub Standard Fork & Pull Request Workflow
- Fork this repository on GitHub.
- Clone the project to your own machine.
- Commit changes to your own branch.
- Push your work to your own fork.
- Submit a Pull Request so I can review your changes
If you find this script useful, you can support me by donating items via steam.
Steam Trade Link