Skip to content

Eve-Time is a simple Discord bot created to fetch and display the current time in various time zones, including the Eve Online time (UTC).

Notifications You must be signed in to change notification settings

kaspaeve/Eve-Time

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Eve-Time Discord Bot

Eve-Time is a simple Discord bot created to fetch and display the current time in various time zones, including the Eve Online time (UTC).

Example

Table of Contents

Features

  • Fetch the current UTC time (Eve Online time).
  • Display the current time in various US time zones (EST, CST, MST, PST).
  • Enhanced error handling to gracefully handle unexpected issues and provide informative feedback.
  • Integrated logging mechanism that tracks both regular and error activities, making debugging and tracking easier.

Dependencies

To ensure that the bot runs smoothly, you must install a few dependencies. Here's a list of everything you'll need:

1. Discord.py

This is the main library that allows our script to interact with the Discord API.

pip install discord.py

2. Datetime

While it's a built-in module in Python, you might need it to handle date and time functionalities.

3. Pytz

This library allows you to work with time zones.

pip install pytz

4. Python Decouple

Useful for extracting configuration values from .env files.

pip install python-decouple

Configuration

  1. Clone the repository:

    git clone https://github.com/kaspaeve/Eve-Time.git
  2. Navigate to the project directory:

    cd Eve-Time
  3. Create a .env file in the root directory and add your Discord bot token and the ID of the allowed channel:

    BOT_TOKEN=Your_Discord_Bot_Token
    ALLOWED_CHANNEL_ID=Your_Allowed_Channel_ID
    FEED_CHANNEL_ID=Your_patch_notes_Channel_ID

Running the Bot

  1. Execute the Python script:
    python chuck.py

Once the bot is running, use the !time command in the allowed channel to fetch and display the current time.


Note: Ensure you have the necessary Python packages installed and the environment properly set up to run the bot.

Docker-Compose Deployment

Deploying the Eve-Time bot using Docker and docker-compose simplifies the process by handling the dependencies and ensuring consistent behavior across different environments.

Prerequisites:

Steps:

  1. Clone the repository:

    git clone https://github.com/kaspaeve/Eve-Time.git
    
  2. Navigate to the project directory:

    cd Eve-Time
    
  3. Ensure your .env file is set up in the root directory with the necessary values:

    BOT_TOKEN=Your_Discord_Bot_Token
    ALLOWED_CHANNEL_ID=Your_Allowed_Channel_ID
    
  4. Use Docker Compose to build and start the bot:

    docker-compose up --build -d
    

    The --build flag ensures that the Docker image is built using the provided Dockerfile, and the -d flag runs the container in detached mode.

  5. Check the bot logs (if necessary):

    docker-compose logs -f
    

    The -f flag lets you follow the logs in real-time.

  6. Stopping the bot:

    docker-compose down
    

This approach ensures that your bot runs in an isolated environment, making it less susceptible to discrepancies between development and production environments.

**Docker-Compose YML

services:
  eve-time-bot:
    image: kaspa101/eve-time:latest
    environment:
      - BOT_TOKEN=your_bot_token
      - ALLOWED_CHANNEL_ID=your_allowed_channel_id

About

Eve-Time is a simple Discord bot created to fetch and display the current time in various time zones, including the Eve Online time (UTC).

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published