Jellybot
A Discord bot designed for taking self-hosted media server requests from users
What's it for?
If you're coming across this, you probably have a Jellyfin or Plex Media server that you host. I encountered a problem when it came to having users other than myself. There was no easy way to accept media requests from users.
That's where Jellybot comes in! It allows you to set up a Discord Bot in a server of your own to accept submissions from users. It also allows you to set up a receipt channel where you can see the history of all fulfilled media, will DM users when their requests have been fulfilled, allows you to sort requests by type, and much more!
How do I set it up?
The one thing you must know is that this isn't like most bots you will see. You have to host the bot yourself because I don't have the hardware, time, or knowledge to host it for you and it's designed for people who have experience self-hosting anyway. It's very low-power, so it will have no problem running on the same machine that you host your media server on.
TL;DR and ASAP Setup instructions at the bottom
Register a bot with Discord
Even if you already have one made, I emplore you to read this section to make sure it has all of the permissions it needs. I won't go into extreme detail (anyone is absolutely welcome to create a PR to make this more in-depth) but the basics are that you need to select "bot", "register application commands", and "send messages" in the URL generator of the bot. Then, add the bot to your server of choice.
Install Node.JS
This bot is written for Discord.js v13.5.0 which requires at least Node v16.9. Click on the Node hyperlink and select Current, probably on the right.
Download bot code and install dependencies
Download the zip of the code from the repo by clicking Code (in green above) and then "Download Zip." Extract the folder into your desired location and open a Terminal/Cmd window there. In that terminal, run npm install discord.js
, npm install @discordjs/rest
, and npm install sqlite3
. You will likely get vulnerability errors for that last package, but it shouldn't be an issue as we're not dealing with high sensitivity data here.
Configure the Bot
You're on the home stretch! Open constants.json and get ready to set some values! Replace the placeholder text with the information you want to give the bot. The "database" value is just a path to the database of requests.
Run the Bot
This is it! In the same terminal window you installed the dependencies with (if you closed it, open another in the same place) and-- hold on. I need to intorduce you to the Launch Options.
Base Command: node index.js
Arguments:
-crg
Registers the commands for your bot globally-cr <id>
Registers the commands for a certain guild (you will get duplicates if you do both global and private)-dcr <id>
De-Registers all commands for a certain guild-dcrg
De-Registers all global commands
When should you use them? It depends on your use case, really. Basically, global commands won't appear in guilds for 1 hour after they are registered. Why they decided to do this? I'm not entirely sure! But global commands will work without re-registering if you add the bot to a new guild, as well as being able to be used in the bot's DMs. Local commands will be applied instantly but are per-guild and cannot be used in the bot's DMs.
For most people, I recommend using -cr until you decide that's not working well for you. So for example, the full command when registering commands for a guild with an ID of 859116276689666088
would be node index.js -cr 859116276689666088
. You only have to register once after the commands are updated. So if you add a command of your own, you have to register again. You don't have to de-register, though!
If you have any issues, feel free to DM me on Discord at Vyladence#9110 or join my Discord Server.
ASAP Setup
- Create a bot in Discord Developer Portal and add it to your server with the "bot" and "application.commands" scopes, as well as the "send messages" permission in the bot's OAuth URL Generator and add the bot to the guild you plan on using it in.
- Install Node.JS Current
- Download the latest release of Jellybot and extract
- Open a CMD or Terminal window in the extracted folder
- Run the following >
npm install discord.js
npm install @discordjs/rest
npm install sqlite3
- Change the unset values in constants.json to the correct information for your bot
- Copy the ID for the guild you added the bot to
- Once again in the terminal window you opened (open a new one if you closed it), run
node index.js -cr <guild id>
That should be it! I still do recommend you read the rest of the readme when you have time