This Discord bot allows users to register their player ID (Steam or Gamepass) and request temporary VIP status for a certain amount of time on connected servers. The bot integrates with an external API to manage VIP status for players and stores player information in a local SQLite database.
ToDo: Execute the following commands after downloading:
- Copy the
.env.dist
file to.env
and enter your values. - Run the command
pip install python-dotenv
. - Copy
frontline-pass.service.dist
to/etc/systemd/system/frontline-pass.service
- Activate and start the service with
sudo systemctl enable frontline-pass.service
andsudo systemctl start frontline-pass.service
.
- Player Registration: Users can register their player ID (Steam-ID or Gamepass-ID) through a modal window.
- VIP Request: Users can request VIP status for a predefined number of hours. The bot communicates with an external API to grant VIP status.
- Persistent Player Data: Player information is stored in a SQLite database, allowing for easy retrieval and VIP management.
- Localized Time Support: The bot handles time zone conversion to display VIP expiration times in local time (set to Europe/Berlin by default).
- Python 3.8+
- Discord account and server where the bot will be used
- API endpoint to manage VIP status
.env
file with the following keys:DISCORD_TOKEN
: Your Discord bot tokenAPI_URL
: The URL of the VIP management APIAPI_KEY
: The API key for authenticationVIP_DURATION_HOURS
: Duration of the VIP status in hoursCHANNEL_ID
: The ID of the Discord channel where the bot will post the initial message
-
Clone the repository:
git clone https://github.com/yourusername/your-repository.git cd your-repository
-
Install the required Python dependencies:
pip install -r requirements.txt
-
Create a
.env
file in the root directory with the following content:DISCORD_TOKEN=your-discord-bot-token API_URL=https://your-api-endpoint.com API_KEY=your-api-key VIP_DURATION_HOURS=24 # Example: 24 hours of VIP CHANNEL_ID=your-discord-channel-id
-
Run the bot:
python frontline-pass.py
-
Registering Player ID: Once the bot is running, it will post a message in the specified Discord channel with two buttons. To register, users click the "Register" button and enter their player ID (Steam or Gamepass).
-
Requesting VIP Status: After registration, users can request VIP status by clicking the "Get VIP" button. The bot will send a request to the connected API to grant the user VIP status for the configured duration (in hours).
-
VIP Expiration: The bot will display the expiration time of the VIP status in the local time zone (Europe/Berlin by default).
discord.py
: For Discord bot functionalitysqlite3
: For local database managementrequests
: For sending API requestspytz
: For time zone managementdotenv
: For loading environment variables
Feel free to fork this repository and create a pull request if you want to contribute to the project. You can also open issues if you encounter any problems or have suggestions for new features.
This project is licensed under the MIT License. See the LICENSE file for more details.