Discord bot command extension for aa-structuretimers
Project description
AA Timer Cog
A Discord bot extension for Alliance Auth that adds the /timer add command to create structure timers directly from Discord.
Features
- Discord Slash Command: Use
/timer addto create structure timers - Autocomplete Support: Smart autocomplete for solar systems, structure types, and timer types
- Role-Based Permissions: Configure which Discord roles can use the command
- Channel Restrictions: Optionally limit the command to specific channels
- Full Integration: Works seamlessly with aa-structuretimers
- Rich Embeds: Beautiful Discord embeds for timer confirmation
Requirements
- Alliance Auth >= 4.0.0
- allianceauth-discordbot >= 3.0.0
- aa-structuretimers >= 1.0.0
- py-cord >= 2.0.0
Installation
Step 1: Install the Package
For manual installation (ZIP file):
- Extract the ZIP file to a temporary location
- Navigate to the extracted directory
- Activate your Alliance Auth virtual environment:
source /home/allianceserver/venv/auth/bin/activate
- Install the package:
pip install .
For future pip installation:
pip install aa-timercog
Step 2: Configure Alliance Auth
Add 'timercog' to your INSTALLED_APPS in local.py:
INSTALLED_APPS = [
# ... other apps
'timercog',
]
Step 3: Configure Permissions (Optional but Recommended)
Add the following settings to your local.py:
# Timer Cog Settings
# Discord Role IDs that can use the /timer add command
TIMERCOG_ALLOWED_ROLE_IDS = [
123456789012345678, # FC Role
234567890123456789, # Director Role
# Add more role IDs as needed
]
# Discord Channel IDs where the command can be used (optional)
# If not set or empty, command works in all channels
TIMERCOG_ALLOWED_CHANNELS = [
345678901234567890, # timer-management channel
# Add more channel IDs as needed
]
How to get Discord IDs:
- Enable Developer Mode in Discord (User Settings > Advanced > Developer Mode)
- Right-click on a role or channel and select "Copy ID"
Step 4: Run Migrations
python manage.py migrate
Step 5: Restart Services
For Docker:
docker-compose restart allianceauth_discordbot
For Supervisor (bare metal):
supervisorctl restart myauth:authbot
Usage
Creating a Timer
Use the /timer add slash command in Discord with the following parameters:
Required Parameters:
system: Solar system name (with autocomplete)structure_type: Type of structure (e.g., Astrahus, Fortizar, Keepstar) (with autocomplete)owner: Owner corporation or alliance nametimer_type: Timer type (e.g., Armor, Hull, Final) (with autocomplete)
Optional Parameters:
days: Days until timer expires (0-365)hours: Hours until timer expires (0-23)minutes: Minutes until timer expires (0-59)structure_name: Custom name for the structureobjective: Friendly, Hostile, or Neutral (default: Hostile)location_details: Additional location info (e.g., "Planet VI, Moon 1")notes: Additional notes about the timer
Example Commands
Basic timer (1 hour):
/timer add system:Jita structure_type:Astrahus owner:"Test Corp" timer_type:Hull hours:1
Detailed timer (2 days, 3 hours, 30 minutes):
/timer add system:Jita structure_type:Fortizar owner:"Test Alliance" timer_type:Final
days:2 hours:3 minutes:30 structure_name:"Death Star"
location_details:"Planet IV - Moon 4" objective:Hostile
notes:"Primary target, bring dreads"
Permissions
Users must meet the following requirements to use the command:
- Discord Role: Must have one of the roles specified in
TIMERCOG_ALLOWED_ROLE_IDS - Channel: If
TIMERCOG_ALLOWED_CHANNELSis set, command must be used in one of those channels - Auth: Must be authenticated with Alliance Auth
If permissions are denied, users will receive an ephemeral (private) error message.
Troubleshooting
Command not appearing in Discord
- Make sure the bot has been restarted after installation
- Verify that
'timercog'is inINSTALLED_APPS - Check bot logs for any errors during startup
"You don't have permission" error
- Verify the user's Discord account is linked to Alliance Auth
- Check that the user has the required role (if
TIMERCOG_ALLOWED_ROLE_IDSis set) - Ensure the command is being used in an allowed channel (if
TIMERCOG_ALLOWED_CHANNELSis set)
Solar system or structure not found
- Make sure
django-eveuniversedata is loaded:python manage.py eveuniverse_load_types EveType --category_id 65 python manage.py eveuniverse_load_types EveSolarSystem
Check logs
Bot logs are typically at:
- Docker:
docker-compose logs allianceauth_discordbot - Supervisor:
/home/allianceserver/myauth/log/authbot.log
Development
Project Structure
aa-timercog/
├── timercog/
│ ├── __init__.py
│ ├── apps.py
│ ├── auth_hooks.py
│ ├── cogs/
│ │ ├── __init__.py
│ │ └── timer_cog.py
│ └── migrations/
│ └── __init__.py
├── setup.py
├── README.md
└── LICENSE
Contributing
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
Support
For issues and feature requests, please:
- Open an issue on the GitHub repository
- Join the Alliance Auth Discord server
License
This project is licensed under the MIT License.
Credits
- Built for Alliance Auth
- Integrates with aa-structuretimers
- Works with allianceauth-discordbot
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aa_timercog-0.0.7.tar.gz.
File metadata
- Download URL: aa_timercog-0.0.7.tar.gz
- Upload date:
- Size: 15.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d11d448135196dbcedc78d21267df9fc1c520675ba3df6937fc93681207420a4
|
|
| MD5 |
52812af4ce5b78aaf0c81f4e18d7785d
|
|
| BLAKE2b-256 |
48d24173cca6f51f9bdcc542ff868dfa0ac77988307047668fb40bc53f03fe1c
|
Provenance
The following attestation bundles were made for aa_timercog-0.0.7.tar.gz:
Publisher:
publish.yml on crazydisi/aa-timercog
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aa_timercog-0.0.7.tar.gz -
Subject digest:
d11d448135196dbcedc78d21267df9fc1c520675ba3df6937fc93681207420a4 - Sigstore transparency entry: 731601306
- Sigstore integration time:
-
Permalink:
crazydisi/aa-timercog@5a5c000c2e111bb120c918dfb06be6179633efb6 -
Branch / Tag:
refs/tags/0.0.7 - Owner: https://github.com/crazydisi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5a5c000c2e111bb120c918dfb06be6179633efb6 -
Trigger Event:
release
-
Statement type:
File details
Details for the file aa_timercog-0.0.7-py3-none-any.whl.
File metadata
- Download URL: aa_timercog-0.0.7-py3-none-any.whl
- Upload date:
- Size: 14.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4042a18b8c0ab491e6e935627109ca1ac07ee9874ea046185a4b523f265e7fae
|
|
| MD5 |
2fd0a0a12a61995a0183839751d17258
|
|
| BLAKE2b-256 |
8865f8f44436c1b912a9ed518ecc7943527b107d79d8cd4ca38dde55123e9084
|
Provenance
The following attestation bundles were made for aa_timercog-0.0.7-py3-none-any.whl:
Publisher:
publish.yml on crazydisi/aa-timercog
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aa_timercog-0.0.7-py3-none-any.whl -
Subject digest:
4042a18b8c0ab491e6e935627109ca1ac07ee9874ea046185a4b523f265e7fae - Sigstore transparency entry: 731601310
- Sigstore integration time:
-
Permalink:
crazydisi/aa-timercog@5a5c000c2e111bb120c918dfb06be6179633efb6 -
Branch / Tag:
refs/tags/0.0.7 - Owner: https://github.com/crazydisi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5a5c000c2e111bb120c918dfb06be6179633efb6 -
Trigger Event:
release
-
Statement type: