Git Product home page Git Product logo

daethyra / discord-aiu Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 686 KB

Quickly upload any image type to a web-hook. An efficient Python module designed to upload images to Discord via a webhook. The module ensures image validation, robust error handling, and implements efficient request streaming and concurrent retries for failed uploads.

License: Other

Python 100.00%
automation discord python tool utility webhook webhook-api image-uploader image-uploading component fault-tolerance module recursive resilience

discord-aiu's Introduction

Discord Image Uploader

Brief Description

Discord Image Uploader is an efficient Python module designed to upload images to Discord via a webhook. The module ensures image validation, robust error handling, and implements efficient request streaming and concurrent retries for failed uploads.

Installation Guide

To install Discord Image Uploader, use PDM (Python Development Master):

  1. Install PDM:

    • Follow the installation instructions here.
  2. Clone the Repository:

    • Clone the Discord Image Uploader repository to your local machine.
  3. Install Dependencies:

    • Navigate to the repository's root directory and run:

      pdm install

How to Use the Module

  1. Configure Webhook URL:

    • Replace YOUR_WEBHOOK_URL_HERE in WEBHOOK_URL with your Discord webhook URL.
  2. Place Images:

    • Place images in ./images/ directory.
  3. Run the Module:

    • Execute pdm run ./src/discord_aiu.py. The module will validate and upload the images, logging the process.
  4. Check Logs:

    • Review image_uploader.log for logs and metrics related to the uploads.

Features

  • Request Streaming: Utilizes requests.Session for efficient connection handling.

  • Session Reuse: The same session is used for resending failed images, ensuring connection reuse.

  • Concurrent Retries: Failed images are retried concurrently using ThreadPoolExecutor.

  • Image Validation: Validates image size and dimensions before upload.

  • Error Handling: Appropriately logs errors.

  • Periodic Metrics Logging: Logs metrics periodically during the upload process.


License

This project is licensed under the GNU Affero General Public License (APL).

discord-aiu's People

Contributors

daethyra avatar dependabot[bot] avatar

Stargazers

 avatar  avatar

Watchers

 avatar

discord-aiu's Issues

AI description automation

  • Use transformers to perform image recognition and generate a description
    • Description will need to print to Discord as an embedded message to minimize the visual space it takes

Integrate in multi-hooker

  • create callable module set for
    • github, discord, configurable file for infinite choices.
    • end goal = webhook integration as an LLM agent

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.