Media Submissions is a Discord bot that allows you to configure fully automatic, and user-driven, media of the week/month channels.
This project was funded and open-sourced by DayZ The Lab.
You can specify which channels users should upload their media in, whether it's of the image
, video
or either
type, and when a winner should be chosen.
When a user uploads a message with the specified media in the channel, the 👍
and 👎
emojis will be added to the message, allowing the community to cast their votes. Any message that does not have the specified media attached will be deleted, keeping the submission channels clean of any (potentially unwanted) user feedback. The message with the most up-votes will be chosen as the winner at the specified datetime.
To keep the submission channels clean of any unwanted bot interactions/feedback, the app tries to communicate actions -- like a submissions being denied -- through user DMs, which the user can disable/prevent. This is why you should ask your (participating) users to create/initialize a DM with the bot beforehand, or accept DMs from your server altogether. This could be avoided if we had opted to use Application Commands, but this would have been more inconvenient for anyone trying to submit media as multiple additional steps are required.
Every aspect of this app and it's functionality is configurable, including:
- The media type:
image
,video
oreither
- The time frame: How long do submissions run/when is a winner chosen?
- The emojis used to cast votes:
👍
and👎
by default - Submission and forwarding channels
- In which channel should users post their media?
- In which channel should the winning submissions be posted?
- Submission validation: You can allow user feedback in submission channels
- Media sources:
discord
,imgur
,medal
andyoutube
by default - The submission cooldown - separate from channel slow-mode
- Submission quantity: Should only 1 media attachment be allowed, or a gallery/collection of multiple entries?
- Discussion Threads: Should a public thread be attached to submissions (and the winning submission) to allow organized feedback?
- Block Other Emojis: Should other, non-voting, emojis be automatically removed from submissions?
This application uses the following Discord Gateway Intents:
Guilds
: Required to receive guild message events, and populate channel information.GuildMessages
: Required to receive guild message events, as this is the source of submissions.MessageContent
: This is a Privileged Intent, and is required to determine if a message has either allowed media sources in it's attachments or message content throughvalidationURLs
.GuildMessageReactions
: Required to remove non-vote reactions from submissions, configurable - and can be omitted when not blocking other reactions.
⚠️ Note: TheMessage Content
intent is required, you have to enable it in the Discord Developer Portal, please view our guide if you need more information.
Feel free to analyze the source code if you have (data) security concerns, the intents are utilized in the following files:
./src/message-create.ts
./src/message-delete.ts
./src/message-update.ts
There are multiple ways of hosting this app. Our team recommends hosting production apps with Docker Desktop, as Docker standardizes environments across different machines, and is by far the quickest & easiest to set-up.
-
Download and install Docker
-
Download and extract the source code
-
Create the configuration files: (Choose ONE)
# Unix/Linux cp .env.example .env && cp config.example.ts config.ts # Windows copy .env.example .env && copy config.example.ts config.ts # Powershell Copy-Item .env.example .env; Copy-Item config.example.ts config.ts
-
Provide your environmental variables in the
.env
file -
Provide your app configuration in the
config.ts
file -
Bring the application online in the background:
docker compose up -d
- Download and install NodeJS
- Download and extract the source code
- Open a command prompt in the project root (the directory with
src
, andpackage.json
inside) - Setup the project and it's dependencies:
npm run setup
- Provide your environmental variables in the
.env
file - Provide your app configuration in the
config.ts
file - Build the application:
npm run build
- Bring the application online:
npm run start