From 8c7ae9b76c44f34128fd38f9b36787d4f9dc4371 Mon Sep 17 00:00:00 2001 From: Luna Date: Fri, 8 Feb 2019 18:20:26 -0300 Subject: [PATCH] add dm_channels blueprint --- litecord/blueprints/__init__.py | 4 +++- litecord/blueprints/dm_channels.py | 36 ++++++++++++++++++++++++++++++ run.py | 3 ++- 3 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 litecord/blueprints/dm_channels.py diff --git a/litecord/blueprints/__init__.py b/litecord/blueprints/__init__.py index a22b5b1..9b021b4 100644 --- a/litecord/blueprints/__init__.py +++ b/litecord/blueprints/__init__.py @@ -32,7 +32,9 @@ from .icons import bp as icons from .nodeinfo import bp as nodeinfo from .static import bp as static from .attachments import bp as attachments +from .dm_channels import bp as dm_channels __all__ = ['gateway', 'auth', 'users', 'guilds', 'channels', 'webhooks', 'science', 'voice', 'invites', 'relationships', - 'dms', 'icons', 'nodeinfo', 'static', 'attachments'] + 'dms', 'icons', 'nodeinfo', 'static', 'attachments', + 'dm_channels'] diff --git a/litecord/blueprints/dm_channels.py b/litecord/blueprints/dm_channels.py new file mode 100644 index 0000000..0e24d8e --- /dev/null +++ b/litecord/blueprints/dm_channels.py @@ -0,0 +1,36 @@ +""" + +Litecord +Copyright (C) 2018-2019 Luna Mendes + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 3 of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + +""" + +from quart import Blueprint, request, current_app as app, jsonify +from logbook import Logger + +log = Logger(__name__) +bp = Blueprint('dms', __name__) + + +@bp.route('//receipients/', methods=['PUT']) +async def add_to_group_dm(dm_chan, user_id): + """Adds a member to a group dm OR creates a group dm.""" + pass + + +@bp.route('//recipients/', methods=['DELETE']) +async def remove_from_group_dm(dm_chan, user_id): + """Remove users from group dm.""" + pass diff --git a/run.py b/run.py index f9ffde2..ddebbe8 100644 --- a/run.py +++ b/run.py @@ -35,7 +35,7 @@ import config from litecord.blueprints import ( gateway, auth, users, guilds, channels, webhooks, science, voice, invites, relationships, dms, icons, nodeinfo, static, - attachments + attachments, dm_channels ) # those blueprints are separated from the "main" ones @@ -128,6 +128,7 @@ def set_blueprints(app_): voice: '/voice', invites: None, dms: '/users', + dm_channels: '/channels', fake_store: None,