Giter Club home page Giter Club logo

denscord's Introduction

Hi there!

  • ✨ Write on: Python3, Dart/Flutter, NodeJS, Rust
  • ⚡️ iTalent Technical moderator!
  • Check out my website

denscord's People

Contributors

denver-code avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

denscord's Issues

Bulk search ID checker

Make a quick check if list of IDs could be represented as a list of ObjectID's
image

Test:

def test_bulk_search_one_valid(client):
    test_signup(client)
    token1 = client.post(
    "/api/public/authorisation/signin", 
    json={
        "email": "[email protected]",
        "password": "testpassword",
    }).json().get("token", "")
    user1 = client.get("/api/private/profile", headers={"Authorisation":token1}).json()

    del user1["email"]

    response = client.post("/api/public/profile/bulk",
        json={
            "users": [
                user1["id"],
                "11111891a5d13e63599968cc1"
            ]
        }
    )
    assert response.status_code == 200
    assert response.json() == [
        user1
    ]

Wrong created_at message time

{
  "id": "649096890230315b02ed76da",
  "message": "h e l p",
  "author_avatar": "https://cdn.discordapp.com/embed/avatars/0.png",
  "author_username": "denver-code",
  "created_at": "2023-06-19T17:56:48.316000"
 },

field "created_at" are not changing

User model update, username rules

Username should be without spaces, special characters, unique, limit in 15 chars length

add First and Last names and nickname which could be with spaces but without special chars

Get Guild Error

Route: /api/private/guild/647e1fd3efe1f85852a360ef
Detailed Error Log:

denscord_server_1  | INFO:     192.168.1.130:51279 - "GET /api/private/guild/647e1fd3efe1f85852a360ef HTTP/1.1" 500 Internal Server Error
denscord_server_1  | ERROR:    Exception in ASGI application
denscord_server_1  | Traceback (most recent call last):
denscord_server_1  |   File "/opt/.cache/virtualenvs/denscord-9TtSrW0h-py3.11/lib/python3.11/site-packages/uvicorn/protocols/http/h11_impl.py", line 428, in run_asgi
denscord_server_1  |     result = await app(  # type: ignore[func-returns-value]
denscord_server_1  |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
denscord_server_1  |   File "/opt/.cache/virtualenvs/denscord-9TtSrW0h-py3.11/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__
denscord_server_1  |     return await self.app(scope, receive, send)
denscord_server_1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
denscord_server_1  |   File "/opt/.cache/virtualenvs/denscord-9TtSrW0h-py3.11/lib/python3.11/site-packages/fastapi/applications.py", line 276, in __call__
denscord_server_1  |     await super().__call__(scope, receive, send)
denscord_server_1  |   File "/opt/.cache/virtualenvs/denscord-9TtSrW0h-py3.11/lib/python3.11/site-packages/starlette/applications.py", line 122, in __call__
denscord_server_1  |     await self.middleware_stack(scope, receive, send)
denscord_server_1  |   File "/opt/.cache/virtualenvs/denscord-9TtSrW0h-py3.11/lib/python3.11/site-packages/starlette/middleware/errors.py", line 184, in __call__
denscord_server_1  |     raise exc
denscord_server_1  |   File "/opt/.cache/virtualenvs/denscord-9TtSrW0h-py3.11/lib/python3.11/site-packages/starlette/middleware/errors.py", line 162, in __call__
denscord_server_1  |     await self.app(scope, receive, _send)
denscord_server_1  |   File "/opt/.cache/virtualenvs/denscord-9TtSrW0h-py3.11/lib/python3.11/site-packages/starlette/middleware/cors.py", line 83, in __call__
denscord_server_1  |     await self.app(scope, receive, send)
denscord_server_1  |   File "/opt/.cache/virtualenvs/denscord-9TtSrW0h-py3.11/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 79, in __call__
denscord_server_1  |     raise exc
denscord_server_1  |   File "/opt/.cache/virtualenvs/denscord-9TtSrW0h-py3.11/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 68, in __call__
denscord_server_1  |     await self.app(scope, receive, sender)
denscord_server_1  |   File "/opt/.cache/virtualenvs/denscord-9TtSrW0h-py3.11/lib/python3.11/site-packages/fastapi/middleware/asyncexitstack.py", line 21, in __call__
denscord_server_1  |     raise e
denscord_server_1  |   File "/opt/.cache/virtualenvs/denscord-9TtSrW0h-py3.11/lib/python3.11/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__
denscord_server_1  |     await self.app(scope, receive, send)
denscord_server_1  |   File "/opt/.cache/virtualenvs/denscord-9TtSrW0h-py3.11/lib/python3.11/site-packages/starlette/routing.py", line 718, in __call__
denscord_server_1  |     await route.handle(scope, receive, send)
denscord_server_1  |   File "/opt/.cache/virtualenvs/denscord-9TtSrW0h-py3.11/lib/python3.11/site-packages/starlette/routing.py", line 276, in handle
denscord_server_1  |     await self.app(scope, receive, send)
denscord_server_1  |   File "/opt/.cache/virtualenvs/denscord-9TtSrW0h-py3.11/lib/python3.11/site-packages/starlette/routing.py", line 66, in app
denscord_server_1  |     response = await func(request)
denscord_server_1  |                ^^^^^^^^^^^^^^^^^^^
denscord_server_1  |   File "/opt/.cache/virtualenvs/denscord-9TtSrW0h-py3.11/lib/python3.11/site-packages/fastapi/routing.py", line 237, in app
denscord_server_1  |     raw_response = await run_endpoint_function(
denscord_server_1  |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
denscord_server_1  |   File "/opt/.cache/virtualenvs/denscord-9TtSrW0h-py3.11/lib/python3.11/site-packages/fastapi/routing.py", line 163, in run_endpoint_function
denscord_server_1  |     return await dependant.call(**values)
denscord_server_1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
denscord_server_1  |   File "/app/api/private/guild/guild.py", line 58, in get_guild
denscord_server_1  |     guild = GuildOut(**guild).dict()
denscord_server_1  |             ^^^^^^^^^^^^^^^^^
denscord_server_1  |   File "pydantic/main.py", line 341, in pydantic.main.BaseModel.__init__
denscord_server_1  | pydantic.error_wrappers.ValidationError: 1 validation error for GuildOut
denscord_server_1  | members_count

Change Key type used for private Guilds

Sometimes generated salt are contains "./$" and other symbols which are cause problems when using em in URL.
So there are 2 variants how we can fix it:

  1. Move guild key to request body
  2. Make key free of restricted chars, such a uuid, etc

Bulk members fetch

Instead of parsing every user separately(new request for each user) make the route able to get list from body, and return list of users.
Or when getMembers of guild return members themselves.

Invite sub route for social

Add invite sub route to url path as in future will be added more social interactions features.
/api/private/social/ -> /api/private/social/invite

Implement delete message route

Task

File to edit:

api/private/guild/message.py

Function delete_message

What has to be done:

  1. Implement checking if all IDs (channel, guild, message-id) are representing ObjectID - if not then return error;
  2. Implement searching all parts(guild, channel, message) , if one of them are None - return error
  3. Implement checking:
    1. If a user is not a member or not the owner of the guild:
      Owners can delete every message.
      Members can only delete messages that are sent by them and they are still a member of a guild.
      If a user were kicked - means that the user is not in the guild anymore, so he can't delete messages, even if he is the author of those messages.
  4. Delete the message and return the successful status
  5. Test for sending message
  6. Test for delete_message route in tests/routes/test_channel.py

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.