JellyDix Server

This is not a bot plugin. It is a web server that allows you to create your own Discord bot and use the JellyDix plugin to send messages with your bot. It is more for server owners and not players as channel IDs are public and easily found.

Requirements

  1. Windows or Linux will work
  2. Python 3.x (Download Python | Python.org)
  3. Python packages (pip3 install discord.py flask)
  4. Discord bot token (https://discordapp.com/developers/applications/)
  5. ca-certificates package if on Linux

Guide

  1. Create a Discord bot
  2. Invite it to your server with scope bot and the following permissions:
    • Send Messages
    • Attach Files
    • Mention Everyone
    • Embed Links
    • Add Reactions
    • more permissions may be required in the future if JellyDix is updated
  3. Get the bot secret token and set it in the TOKEN field inside this Python script
  4. Run the script
  5. Replace the URL in JellyDix with http://127.0.0.1:5000

If you see SSL verification errors it means you’re missing certificates for verification and you will need to edit the code to use a specific file. I have only encountered this issue on Server 2008 R2 so far.

Code

import requests
import io
import json
import discord
import queue
from discord.ext import commands
from flask import Flask
from flask import request
from threading import Thread
from time import sleep

TOKEN = ''
KEY = 'JellyDix'

bot = commands.Bot(command_prefix='!')
app = Flask(__name__)
q = queue.Queue()

async def message_task():
	global q
	try:
		while not q.empty():
			m = q.get()
			await bot.get_channel(m['id']).send(m['message'])
	except Exception as e:
		print(e)

@app.route('/api', methods=['POST'])
def index():
	global q
	try:
		if request.method == 'POST':
			k = request.json['key']
			channel = int(request.json['channel'])
			message = request.json['message']

			if k == KEY:
				q.put({'id': channel, 'message': message.replace('@', '@ ')})
				bot.loop.create_task(message_task())
				return 'success'
	except Exception as e:
		print(e)
	return 'error'

def flask_thread():
	app.run(debug=False, host='0.0.0.0')

def main():
	th = Thread(target=flask_thread)
	th.start()
	bot.run(TOKEN)
	th.join()

main()
2 Likes

Rewrote to use discord.py.

ty <3

@Ryan @JellyBitz

I completed all the steps,bot online,token copied in python and etc…

i taking this error in bot log:

“Plugin: Error loading url [HTTP Error 404: NOT FOUND] to Notify”

and taking this error in CMD screen

“127.0.0.1 - - [21/Jan/2021 23:58:58] “←[33mPOST /api/notify HTTP/1.1←[0m” 404 -”

I think Flask module havent any problem.But I couldn’t find this shit ^^

i remember engels had this error formerly.if your help to me i would be grateful :slight_smile:

This is very old now and may not work with the latest version of the plugin.

So only Engels know last codes… @JellyBitz help me mate

The only difference I can see is about the json key now called token which is sent by plugin like a password.

Problem solved thanks :heartbeat:

Can you please tell how you fixed it? @GAUCHE
[01:46:56] Plugin: Error loading url [HTTP Error 404: NOT FOUND] to Notify
@Ryan please could you help with this error?