Skip to content

Donation bot for Team Fortress 2 🎁

License

Notifications You must be signed in to change notification settings

MarcMogdanz/tf2-donation

Repository files navigation

Donation bot for Team Fortress 2 🎁

Currently this is just kind of a proof-of-concept but it's working!

I'll work more on this if people are interested, so let me know! 😉

Features 💥

  • Accept donations
  • Auto accept trade offers from owners
  • Auto craft metal
  • Notify owners via Steam

Roadmap 👀

  • Notifications via Telegram
  • Auto craft weapons to scrap
  • Auto delete cases (based on type)
  • Save per user donation stats
  • Give ranks on TeamSpeak/Discord
  • Restrictions on what items to accept
  • Backpack full notification
  • Generate auth code for bot account
  • Better logging

Usage :squirrel:

You can either clone the repo yourself and start it directly on your machine, see Local, or build the Docker image which automatically handles all dependencies and does run everywhere, see Docker.

Local

  1. Clone the repository via https or ssh, for help see here.
git clone https://github.com/MarcMogdanz/tf2-donation.git
git clone [email protected]:MarcMogdanz/tf2-donation.git
  1. Make sure you have npm installed and install all dependencies.
npm install
  1. Go into the cloned repository directory and build the javascript files, you need to have python installed.
npm run build
  1. Setup your config, see here in the README.

  2. Start up the bot.

npm run start

Docker

  1. Clone the repository via https or ssh, for help see here.
git clone https://github.com/MarcMogdanz/tf2-donation.git
git clone [email protected]:MarcMogdanz/tf2-donation.git
  1. Make sure you have Docker installed, for help see here.

  2. Go into the cloned repository direcotry and build the image. We build the local Dockerfile, name it tf2 and tag it with latest.

docker build . -t tf2:latest
  1. Setup your config, see here in the README.

  2. Run the image (start the bot). We start the image tf2 with the latest, which we've just built and mount a volume containing our config/ directory. Note the :ro at the end, this tags the volume as read-only to ensure no unwanted changes to your config file will be made.

docker run -v "${PWD}/config/:/app/config/:ro" tf2:latest

Note: This should run on Linux and on Windows via Powershell, see here for more. See below if you want to use it on Windows via cmd.

docker run -v "%cd%/config/:/app/config/:ro" tf2:latest

Config 🔧

The general schema of the config is:

interface Config {
  steam: {
    account: {
      name: string;
      password: string;
      sharedSecret: string;
      identitySecret: string;
    };
  };
  bot: {
    autoCraftMetal: boolean;
  };
  owners: string[];
}

You need to set your steam name (not the display name!) and password as well as your shared secret and identity secret. There are multiple ways to get the later two:

I recommend to use the SteamDesktopAuthenticator as it's easy to use, built for exactly this purpose and also a useful tool. Also you should use a dedicated steam account for this!

The owners array needs to be an array of SteamID64 of the owners. You can find your SteamID64 here.

Contributing 🚀

The easiest way to contribute is to contact me and tell me what you need or want. You can also create an issue containing a feature request or bug report!

And of course feel free to create PRs! 😉

Credits ❤️

The most credits go to Alex Corn for all of his awesome npm packages (node-steam-user, node-steam-tradeoffer-manager, node-steam-totp, node-steamcommunity, node-tf2).

And also to Andrew Dassonville for his easy to follow guide on how to get started with all of this.

License 🔍

This repository is published under the MIT License.

About

Donation bot for Team Fortress 2 🎁

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published