Skip to main content

EVE ADM Bot

GitHub Workflow Status PyPI PyPI - Python Version codecov

This is a discord bot which will collect alliance system ADM's daily and provide commands to display them in a convenient tier list.

⚡ Quick Start

From PyPI

# 1. Set up environment (pick option)

# 1.1 With exported variables:
export DISCORD_TOKEN=your-token-here
export DISCORD_CHANNEL=your-channel-here
export DISCORD_GUILD_ID=your-guild-id
export DISCORD_APP_ID=your-app-id-here
export ALLIANCE_ID=your-alliance-id-here
export DB_SERVICE=sqlite
export DB_CONNECTION_STRING=adm-data.sqlite
export DB_KEEP_ADM_DAYS=7

# 1.2 With .env file:
cp .env.example .env

# 2. Install package from PyPI
pip install pydisadm

# 3. Run Bot
python -m pydisadm

From source

# 1. Clone repository
git clone https://github.com/agelito/adm-bot
cd adm-bot

# 2. Copy and edit .env
cp .env.example .env

# 3. Install dependencies
poetry install

# 4. Run bot
poetry run python pydisadm/__main__.py

📃 Commands

  • /adm summary - send a summary of ADM's
  • /adm csv - send a csv of ADM's
  • /adm history <name> - send a graph showing system, constellation, or region ADM over time
  • /adm update <system> - manually update ADM for system
  • /adm recommend - recommend a system to raise ADM in

Maintenace

  • /adm refresh - manually refresh the data
  • !adm_sync_commands - synchronise the interactive discord commands (only required once)

🔧 Configuration

Configuration is done using environment variables or dotenv. See .env.example for example configuration.

  • DISCORD_TOKEN - the token bot should use when communicating with discord.
  • DISCORD_CHANNEL - the channel name bot should listen too, if this is empty the bot will listen to all channels.
  • DISCORD_GUILD_ID - the discord server bot should be part of
  • DISCORD_APP_ID - the bot application ID
  • ALLIANCE_ID - the alliance ID for collecting ADM values, only systems owned by this alliance will be collected.
  • ALLIANCE_IGNORE_TCU - set to any value to ignore TCU's when collecting ADM values
  • DB_SERVICE - which database to use, can be: sqlite or mysql
  • DB_CONNECTION_STRING - the connection string
  • DB_KEEP_ADM_DAYS - how many days adm history should be kept in database (default 7).

DB_CONNECTION_STRING examples

  • sqlite - adm-data.sqlite a file name
  • mysql - root:root@127.0.0.1:3600/pydisadm - a connection string (user:password@host:port/database). See mysqlclient for more information

🔍 Caveats

  • The ADM data from ESI is only updated once a day, so refreshing more often than that is not necessary.
  • The database will continue to fill up with historic entries, manually inspect size and purge older entries if it's too big.

🚧 Development

Environment

The development environment and dependencies is managed using poetry. Use the following command to set up environment and install dependencies:

poetry install

A nested poetry shell can be started using this command:

poetry shell

Run Linting

pylint --rcfile pylint.rc pydisadm/**/*.py

Run Unit Tests

pytest tests/ --cov=pydisadm --cov-branch

💡 Credits

Project is forked from and inspired by @anjode

Metadata

Release files for pydisadm 2.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pydisadm 2.2.0
File Size Uploaded
pydisadm-2.2.0.tar.gz 1.1 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for pydisadm 2.2.0
File Interpreter ABI Platform
pydisadm-2.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 2.2 MB

Release files / pydisadm-2.2.0.tar.gz

Download URL pydisadm-2.2.0.tar.gz
Size 1.1 MB
Tags Source
SHA-256 checksum
How to use checksums
c173b150db33078c4bf64bd5e9e6dce5a0ae81302e0f8b0044562c3f4ca9014b
BLAKE2b-256 checksum
How to use checksums
3271ad3fa1fb850629ae6684301b0bd009214e08279aea01ee6a627b69f65413
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Release files / pydisadm-2.2.0-py3-none-any.whl

Download URL pydisadm-2.2.0-py3-none-any.whl
Size 1.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
977074d5284f942271da3dcba5296badbe74ad6c0d98cc276a9245212253b980
BLAKE2b-256 checksum
How to use checksums
b42d6951ee047d962e7ca6d1f22604fcdc02a33bb125ee18c182e8acf76986d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Release history Release notifications | RSS feed

This release

2.2.0 This release

2 release files

2.1.4

2 release files

2.1.3

2 release files

2.1.2

2 release files

2.1.1

2 release files

2.1.0

2 release files

2.0.0

2 release files

1.3.2

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.5

2 release files

1.2.4

2 release files

1.2.3

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page