This repository contains a Discord bot script that allows users to declare their absence through a Discord interaction. The bot is built using discord.py
, a Python wrapper for the Discord API.
- Absence Declaration Modal: Users can declare their absence by filling out a form with their name, date, and reason for absence.
- Embeds: The bot sends an embed message with the declared absence details.
-
Clone the repository:
https://github.com/CiscoDerm/FIVE_M_ABSENCE.git cd FIVE_M_ABSENCE
-
Install dependencies:
Make sure you have
discord.py
installed. You can install it using pip:pip install discord.py
-
Configure the bot:
- Replace
TOKEN_BOT
in the script with your actual Discord bot token. - Replace
ID_CHANNEL
with the ID of the Discord channel where you want the bot to send the absence declaration button.
- Replace
-
Run the bot:
python absence.py
Once the bot is running, it will send a message in the specified channel with a button labeled "Absence". Users can click this button to open a modal where they can enter their name, the date of absence, and the reason for their absence. Upon submission, the bot will send an embed message with the provided information.
- AbsenceModal: A modal class that defines the form for absence declaration.
- AbsenceView: A view class that defines the button for triggering the absence modal.
- on_ready: An event that sends the initial message with the absence button when the bot is ready.
- Main Execution: The bot is run using the provided token.
If you would like to contribute to this project, please open an issue or submit a pull request.