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?

Can Anyone help me
Plugin: Error loading url [<urlopen error [WinError 10061] Es konnte keine Verbindung hergestellt werden, da der Zielcomputer die Verbindung verweigerte>] to Notify

its still work u just need edit 2 line like there
vvvvvv

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/notify', methods=['POST'])
def index():
	global q

	try:
		if request.method == 'POST':
			k = request.json['token']
			print(k)
			channel = int(request.json['channel'])
			print(channel)
			message = request.json['message']
			print(message)
			if k == KEY:
				print('put')
				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()

And change URL
In plugin jellydix in token u need paste JellyDix

Edit:
for ppl who donā€™t use python u need have a python instaled with a libraries.
if u donā€™t know what is this just donā€™t try or goole this.

Well, somebody maybe can help meā€¦

i got in JellyDix Plugin this error:
[17:30:47] Plugin: Error reading response from server [Expecting value: line 1 column 1 (char 0)]

in Terminal of server.py i got this

JellyDix
866364496518840330
||17:30:46|| [Guild] ****: .
put
127.0.0.1 - - [21/Jan/2022 17:30:47] ā€œPOST /api/notify HTTP/1.1ā€ 200 -

u bot is online when u run serve?
bot have permision?

Seems that the intent approach has changed in the discord API, so I fixed it. I have as well fixed the response from the JellyDix Server to the bot (bot now understands the response correctly). And Iā€™ve modified how TOKEN is used in the code. Hereā€™s my updated version of the 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 = '<YOUR DISCORD BOT TOKEN GOES HERE>'
#KEY = ''

bot = commands.Bot(command_prefix='!',intents=discord.Intents.all())
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/notify', methods=['POST'])
def index():
	global q

	try:
		if request.method == 'POST':
			k = request.json['token']
		   
			channel = int(request.json['channel'])
				 
			message = request.json['message']
				 
			if k == TOKEN:
				print(message[message.find("|"):message.rfind("|")+1]+ " - Message sent to Discord channel")
				q.put({'id': channel, 'message': message.replace('@', '@ ')})
				bot.loop.create_task(message_task())
				return {"success":True}
	except Exception as e:
		print(e)
		return {"success":False, "message":"Something went wrong, the message was not sent"}

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()

can any one help me with that error?

Plugin: Error loading url [HTTP Error 501: Unsupported method (ā€˜POSTā€™)] to Notify

Hello it was working good for months but today i getting this error can anyone help ? @Ryan

Traceback (most recent call last):
  File "/home/runner/Discordpy/venv/lib/python3.10/site-packages/flask/app.py", line 2525, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/runner/Discordpy/venv/lib/python3.10/site-packages/flask/app.py", line 1823, in full_dispatch_request
    return self.finalize_request(rv)
  File "/home/runner/Discordpy/venv/lib/python3.10/site-packages/flask/app.py", line 1842, in finalize_request
    response = self.make_response(rv)
  File "/home/runner/Discordpy/venv/lib/python3.10/site-packages/flask/app.py", line 2134, in make_response
    raise TypeError(
TypeError: The view function for 'index' did not return a valid response. The function either returned None or ended without a return statement.

Awesome, Worked perfectly
I even used port forwarding, so I can use different PC + IP

i has same Error how to fix it ?

@Ryan can you whitelist the JellyDix plugin itself? It aint loading for me even without the API url modification, so i guess itā€™s not whitelisted for trsro, right? thanks

Did this plugin working for the Vtc server?