https://github.com/jhviw/secret-santa-bot
SteamBot and Discord Bot for Secret Santa Event Management. Automates Secret Santa assignments, trade offers, and Discord interactions for a festive experience in your server!
https://github.com/jhviw/secret-santa-bot
discord-bot discord-gifts secret-santa
Last synced: 3 months ago
JSON representation
SteamBot and Discord Bot for Secret Santa Event Management. Automates Secret Santa assignments, trade offers, and Discord interactions for a festive experience in your server!
- Host: GitHub
- URL: https://github.com/jhviw/secret-santa-bot
- Owner: JHVIW
- Created: 2023-10-04T15:22:56.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-06-07T18:37:10.000Z (12 months ago)
- Last Synced: 2025-01-12T11:44:59.093Z (4 months ago)
- Topics: discord-bot, discord-gifts, secret-santa
- Language: JavaScript
- Homepage:
- Size: 182 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Secret Santa Bot
[](https://github.com/JHVIW/Secret-Santa-Bot/stargazers)
[](https://github.com/JHVIW/Secret-Santa-Bot/network)
[](https://github.com/JHVIW/Secret-Santa-Bot/issues)Secret Santa Bot is a festive project designed to bring the joy of gift-giving to your Discord servers! Built with a dual-bot architecture, it integrates with both Discord and Steam platforms to automate the Secret Santa process from start to finish.
- **Automatic Assignments:** Effortlessly pairs participants for Secret Santa, ensuring that no one gets left out and each person receives a gift.
- **Steam and Discord Integration:** Seamlessly manages gift exchanges through Steam trade offers and Discord interactions, creating a delightful user experience.
- **Event Management:** Provides tools for admins to oversee the Secret Santa event, track gift exchanges, and ensure that everyone follows the spirit of giving.## SteamBot.js
### Dependencies
- `SteamUser`: For Steam client functionality.
- `SteamCommunity`: For Steam community interactions.
- `SteamTotp`: For generating Steam two-factor authentication codes.
- `TradeOfferManager`: For handling trade offers on Steam.
- `ToadScheduler` and `node-schedule`: For scheduling tasks.
- `fs`: For file system operations.
- `dotenv`: For loading environment variables.
- `Discord.js`: For Discord bot functionality.### Features
- Handles Steam user login and game status.
- Manages Steam trade offers and sets up cookies.
- Periodically checks for new trade offers and automatically accepts certain offers.
- Logs events to a specified Discord channel.
- Reads and updates participant data in a JSON file.
- Schedules trade sending on December 25th.## Bot.js
### Dependencies
- `Discord.js`: For Discord bot functionality.
### Features
- Provides a Discord bot for managing the Secret Santa event in your server.
- Sends welcome messages and event instructions when the bot starts.
- Allows users to sign up for the event by providing their Steam trade link and interests.
- Supports an administrator-only command for pairing participants.
- Handles errors and permissions gracefully.
- Shuffles participants for Secret Santa assignments.
- Sends private messages to participants with their assigned recipients' information.
- Supports checking signups and ensuring all participants are properly registered.### Newest Functions
- **assignParticipants:** Assigns Secret Santa pairs, ensuring each participant has a unique recipient.
- **extractSteamID64:** Extracts SteamID64 from a provided trade link.
- **findUniqueReceiver:** Finds a unique receiver for each sender to ensure no participant is assigned twice.
- **shuffleArray:** Shuffles an array using the Fisher-Yates algorithm for random assignment.## How to Use
1. Set up your Discord bot and get the bot token.
2. Create a `.env` file with the following environment variables:
- `DISCORD_TOKEN`: Your Discord bot token.
- `STEAMUSERNAME`: Your Steam username.
- `PASSWORD`: Your Steam password.
- `SHAREDSECRET`: Your Steam shared secret.
- `IDENTITYSECRET`: Your Steam identity secret.
3. Install the required Node.js packages using `npm install`.
4. Run `SteamBot.js` and `Bot.js` separately in your Node.js environment.
5. Follow the instructions in your Discord server to participate in the Secret Santa event.## Important Notes
- Ensure that your Steam account and trade link are correctly configured.
- Modify the Discord channel and event details to fit your server's needs.
- Be cautious with your Steam credentials and secrets, and do not share them publicly.Enjoy your Secret Santa event, and happy gifting! 🎅🎁🌟