How to Automatically Post Images into a Discord Channel

by Lenny Zulauf
15 minutes read

How to Automatically Post Images into a Discord Channel

Discord Picture Auto Upload Saturate Picture

Tote out you sprinted a Discord web server and would decide to immediately devise-up images to a information network at invariant periods without coaching a finger? This post will undoubtedly underline you how to immediately upload images relevant into a Discord network gaining service of the Discord-AIU tool and habit manuscripts.

Web content
  • Our Neutral and Toolkit
  • Mounting Discord-AIU
  • Design a Webhook Endpoint for Your Network
  • Configure Discord-AUI Placements
  • Immediately Post Abounding Images to Discord
  • Schedule Discord-AUI to Implement at Ordinary Intervals

Our Neutral and Toolkit

Picture you’re dashing a Discord web server carried out to anime, and you pine to preserve your members entailed with fresh fan art uploaded every day. The pointer seems humble to enforce: you just have to remember to devise-up an image every 24 hours, relevant? Notorious. Liveliness avails bustling, and in the past you understand it, your members are hollering at you, wondering wherein their everyday dosage of anime benefits owns gone. That’s wherein automation comes in to preserve the day – and your sturdiness.

To immediately devise-up images to your Discord network, we’ll be gaining service of a mix of tools and manuscripts. Our pivot unbiased is to sported a mechanism that will undoubtedly on a frequent basis upload images to your identified Discord network without any kind of manual treatment. We’ll be gaining service of the Discord-AIU (Automated Picture Uploader) tool as our keystone, along with some habit manuscripts to oversaw the appointment and image array procedure.

Mounting Discord-AIU

Currently that we’ve laid out our unbiased, make it viable for’s build our image upload bot gaining service of Discord-AIU. Initially, you’ll have to download Discord-AIU from its GitHub repository. I suggest you grab the most current variation and unpack it in a optimal gap. The tool is arisen in Python, so you can sprinted it on any kind of sizeable operating mechanism.

Download Discord Aiu From Github

Once you’ve downloaded and install Discord-AIU, you have to sported the crucial Python dependences. If Python is sported on your mechanism, after that you can just amenable your incurable or command incite, surf to the Discord-AIU directory internet site, and sprinted the command pdm install (you can in a equivalent way have to sported PDM to perform it).

Discord Aiu Dependences Installation

The command will undoubtedly sported all the crucial approaches for the tool to unbiased duly, namely padding, python-dotenv, and petitions.

Design a Webhook Endpoint for Your Network

The next procedure is to build a webhook endpoint in your Discord web server. This webhook is the relationship juncture between Discord-AIU and your web server. To tote out this, amenable your Web server Placements and surf to the Assimilations tab.

Discord Design Webhook

Click on the Design Webhook switch, and you’ll be sported with selections to tailor your webhook. You can modify the avatar, decide the network wherein images will undoubtedly be uploaded, and impart your webhook a name.

Discord Photocopy Webhook Url

After placement these up, you can click the Photocopy Webhook URL switch to attain the URL of the newly obtained webhook.

Configure Discord-AUI Placements

Through your webhook sported, it’s time to configure Discord-AIU. Open the Discord-AUI folder and surf to the src subfolder.

Discord Aiu Src Subfolder

There, commendable aesthetic beauties for a document labelled discord_aiu.py and amenable it in your favored message editor. Paste your Webhook URL in the synchronizing setup recourse foreseeable the top of the document. It have to commendable aesthetic beauties something decide this:

WEBHOOK_URL = "https://discord.com/api/webhooks//YOUR_WEBHOOK_TOKEN"

I in a equivalent way suggest you match the FOLDER_PATH setup recourse based on your tastes. By default, it’s established to:

FOLDER_PATH = './images/'

This trail is loved one to the gap of the discord_aiu.py document. In other words, the “images” folder have to be obtained in unchanged directory internet site as the discord_aiu.py manuscript. Feel generate to preserve the document and build the folder currently.

Immediately Post Abounding Images to Discord

To checkup if Discord-AUI works as it have to, gap one or more instance images in your newly identified images folder. Then, amenable your incurable or command incite, surf to the Discord-AIU directory internet site, and sprinted the consequent command:

pdm run ./src/discord_aiu.py

If everything is sported correctly, you have to go to all checkup images show up in the alloted Discord network within moments. You can in a equivalent way commendable aesthetic beauties at the tool’s output, which have to educate you uniquely how numerous images have been entirely uploaded.

Discord Aiu

The standoffish wrangle is that the command always uploads all images in the identified folder in mass. While that can be madly valuable and time-saving if you have to share numerous images with your cosmopolitan, our unbiased is to upload one image at a time to Discord immediately at invariant periods. The commendable news is, all we stock is a habit manuscript.

Schedule Discord-AUI to Implement at Ordinary Intervals

Currently that we’ve verified Discord-AUI works, make it viable for’s automate the procedure to devise-up images at invariant periods. We’ll build a manuscript that implements the consequent openings:

  1. Cures a random document from a queue folder.
  2. Moves it to the images folder.
  3. Implements the Discord-AUI tool.
  4. Moves the uploaded image to an “uploaded” folder.

If you’re gaining service of Abode windows, after that you have to build a new-made plaintext document (you can service Notepad) and xerox and paste the consequent code:

$QUEUE_FOLDER = "C:pathtoDiscord-AIUsrcqueue" $IMAGES_FOLDER = "C:pathtoDiscord-AIUsrcimages" $UPLOADED_FOLDER = "C:pathtoDiscord-AIUsrcuploaded" $DISCORD_AIU_PATH = "C:pathtoDiscord-AIUsrcdiscord_aiu.py"   # Pick a random file from the queue $RANDOM_FILE = Get-ChildItem -Path $QUEUE_FOLDER | Get-Random -Count 1   if ($RANDOM_FILE) {     # Move the file to the images folder     Move-Item -Path $RANDOM_FILE.FullName -Destination $IMAGES_FOLDER       # Run Discord-AIU     Set-Location -Path "C:pathtoDiscord-AIU"     pdm run $DISCORD_AIU_PATH       # Move the processed file to the uploaded folder     $PROCESSED_FILE = Get-ChildItem -Path $IMAGES_FOLDER     Move-Item -Path $PROCESSED_FILE.FullName -Destination $UPLOADED_FOLDER }

Preserve the manuscript as manuscript.ps1 or something unchanged (.ps1 is the expansion of PowerShell manuscripts).

Linux and macOS users can build a manuscript.sh document with the consequent fun manuscript:

#!/bin/bash   QUEUE_FOLDER="/path/to/Discord-AIU/src/queue" IMAGES_FOLDER="/path/to/Discord-AIU/src/images" UPLOADED_FOLDER="/path/to/Discord-AIU/src/uploaded" DISCORD_AIU_PATH="/path/to/Discord-AIU/src/discord_aiu.py"   # Pick a random file from the queue RANDOM_FILE=$(find "$QUEUE_FOLDER" -type f | shuf -n 1)   if [ -n "$RANDOM_FILE" ]; then     # Move the file to the images folder     mv "$RANDOM_FILE" "$IMAGES_FOLDER"       # Run Discord-AIU     cd /path/to/Discord-AIU && pdm run "$DISCORD_AIU_PATH"       # Move the file to the uploaded folder     mv "$IMAGES_FOLDER"/* "$UPLOADED_FOLDER" fi

Don’t forget to build the crucial folders and match the training courses to mirror their places, and the gap of the Discord-AIU folder itself. You in a equivalent way have to render the manuscript executable gaining service of the chmod +X /path/to/script command.

Finally, you have to itinerary the manuscript.ps1 (Abode windows) document or the manuscript.sh (Linux and macOS) document to sprinted immediately – make it viable for’s say once a day.

As a Abode windows user, you can amenable the Project Scheduler by browsing for it in the Prelude menu. Click on Design Need Project in the relevant panel and impart your chore a name, such as “Discord Picture Uploader”.

Project Scheduler Abode windows Design Need Project

Drifter Daily for the activate and established your favored time. For the reaction, pick Prelude a regimens. In the Schedule/manuscript industry, enter “powershell”, and in the Add differences industry, enter -ExecutionPolicy Bypass -File "C:pathtoyourscript.ps1".

Crontab Macos

If you’re gaining service of Linux or macOS, you can amenable your incurable and kind

crontab -e

to modify your cron occupational (you can in a equivalent way service sudo EDITOR=nano crontab -e to service the Nano editor instead of Vim).

Add a new-made queue to sprinted the manuscript everyday at 12:00 PM (noontime), which aesthetic beauties decide this:

0 12 * * * /path/to/your/script.sh

Preserve and take off the editor.

Through these measures completed, your picked manuscript will undoubtedly sprinted immediately every day, confirming your Discord network fresh with new-made images. Merely remember to preserve your queue folder adorned with new-made images to ensure a stable stream of web content. If you would decide to render your web server an also more amusing gap to visit, after that you can comply with up by identifying out how to turn your Raspberry Pi relevant into a Discord radio station.

Picture and screenshots by David Morelo.

Related Posts