add dm_channels blueprint

This commit is contained in:
Luna 2019-02-08 18:20:26 -03:00
parent 2ffa3cb82d
commit 8c7ae9b76c
3 changed files with 41 additions and 2 deletions

View File

@ -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']

View File

@ -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 <http://www.gnu.org/licenses/>.
"""
from quart import Blueprint, request, current_app as app, jsonify
from logbook import Logger
log = Logger(__name__)
bp = Blueprint('dms', __name__)
@bp.route('/<dm_chan:int>/receipients/<int:user_id>', 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('/<dm_chan:int>/recipients/<user_id:int>', methods=['DELETE'])
async def remove_from_group_dm(dm_chan, user_id):
"""Remove users from group dm."""
pass

3
run.py
View File

@ -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,