This repo contains the source code for the old FreeStuff Bot for Discord, based on discord.js. This codebase has been deprecated and remains readonly.
^ code quality is A; please keep it that way when PR-ing :)
master As the stable, production ready branch. Deploys run right from master.
dev As the development, not-necessarily-stable-but-preferably-stable branch. Please pr here.
Roadmap, Todo, Suggestions, etc: https://trello.com/b/Zhw6umTy/freestuff
- Download the docker-compose.yml file
- Edit the environment variables accordingly
- Pick one mode to run:
- single — is probably what you wanna go for as it just starts one shard and you don't have to worry about anything
- shard — if you need multiple shards, use this mode to specify which ones and how many you want to start
- worker — unless you have a custom manager service this mode will only put the bot in limbo, making it wait forever. You don't wanna use this
- If you want realtime updates you want to start the webhook server. Settings should be self explanatory. If you cannot publish a server for some reason, you have two alternative options:
- Don't have real-time announcements. In this case you can only really use the /free command
- Edit the code to poll and publish announcements through the API. Look at the next section for running the bot from source
- Register slash commands and init database
- Run
node ./scripts/register-commands.js
- Run
node ./scripts/initdb.js
- Run
This bot uses discord.js v13 which required NodeJS v16.0.0 or up.
Make sure to have typescript installed globally or modify the building scripts accordingly.
Run npm i
or yarn install
after cloning.
In the root directory, rename the file config.template.js
to config.js
. Open the file and edit it accordingly.
Now go to /scripts and run the initdb.js file using nodejs: node ./initdb.js
. Make sure to configure your MongoDB connection in config.js before running this script.
You probably also want to register the slash commands by running the node ./register-commands.js
command in the same directory.
For development use
$ npm run dev
# OR
$ yarn dev
For production build first using
$ npm run build
# OR
$ yarn build
... and run using
$ npm start
# OR
$ yarn start
If you need any help, feel free to ask in our discord server. Unfortunately we cannot guarantee to be able to help you with any problem that might occur.
- Andreas May, @maanex — Basically the whole thing
- Seyhan Halil, @EasyThe — Bug fixes
- Rami Sabbagh, @Rami-Sabbagh — Documentation and Docker magic
The FreeStuff Bot for Discord notifies you about free games right in your Discord server. Copyright (C) 2020 - 2021 FreeStuff Contributors
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.