mirror of
https://github.com/TitanEmbeds/Titan.git
synced 2025-06-17 20:05:23 +02:00
Basic message relaying via WS
This commit is contained in:
@ -1,6 +1,22 @@
|
||||
from titanembeds.utils import socketio
|
||||
from flask_socketio import Namespace, emit
|
||||
from flask_socketio import Namespace, emit, disconnect, join_room
|
||||
import functools
|
||||
from flask import request, session
|
||||
|
||||
def authenticated_only(f):
|
||||
@functools.wraps(f)
|
||||
def wrapped(*args, **kwargs):
|
||||
if False:
|
||||
pass
|
||||
#disconnect()
|
||||
else:
|
||||
return f(*args, **kwargs)
|
||||
return wrapped
|
||||
|
||||
class Gateway(Namespace):
|
||||
def on_connect(self):
|
||||
emit('key', {'data': 'Connected', 'best_pone': "rainbow"})
|
||||
emit('hello')
|
||||
|
||||
def on_identify(self, data):
|
||||
room = data["guild_id"]
|
||||
join_room(room)
|
Reference in New Issue
Block a user