mirror of https://gitlab.com/litecord/litecord.git
Compare commits
No commits in common. "b17e0155edce608e738a147f446047dd1db54cb4" and "1f8a4fd304d1240d114be0b2e83e2471b9bdb56c" have entirely different histories.
b17e0155ed
...
1f8a4fd304
|
|
@ -10,7 +10,6 @@ services:
|
||||||
cache:
|
cache:
|
||||||
paths:
|
paths:
|
||||||
- .cache/pip
|
- .cache/pip
|
||||||
- .tox
|
|
||||||
|
|
||||||
tests:
|
tests:
|
||||||
before_script:
|
before_script:
|
||||||
|
|
|
||||||
|
|
@ -92,6 +92,7 @@ async def _resize(image, attach_id: int, ext: str, width: int, height: int) -> s
|
||||||
"/attachments" "/<int:channel_id>/<int:message_id>/<filename>", methods=["GET"]
|
"/attachments" "/<int:channel_id>/<int:message_id>/<filename>", methods=["GET"]
|
||||||
)
|
)
|
||||||
async def _get_attachment(channel_id: int, message_id: int, filename: str):
|
async def _get_attachment(channel_id: int, message_id: int, filename: str):
|
||||||
|
|
||||||
attach_id = await app.db.fetchval(
|
attach_id = await app.db.fetchval(
|
||||||
"""
|
"""
|
||||||
SELECT id
|
SELECT id
|
||||||
|
|
|
||||||
|
|
@ -157,6 +157,7 @@ def emoji_sql(
|
||||||
where_ext = f"AND emoji_id = {param}"
|
where_ext = f"AND emoji_id = {param}"
|
||||||
main_emoji = emoji_id
|
main_emoji = emoji_id
|
||||||
elif emoji_type == EmojiType.UNICODE:
|
elif emoji_type == EmojiType.UNICODE:
|
||||||
|
|
||||||
# fun fact, emojis are length 1 in python? i'll use this to the
|
# fun fact, emojis are length 1 in python? i'll use this to the
|
||||||
# best of my ability, lol
|
# best of my ability, lol
|
||||||
if len(emoji_name) != 1:
|
if len(emoji_name) != 1:
|
||||||
|
|
|
||||||
|
|
@ -363,6 +363,7 @@ async def _process_overwrites(guild_id: int, channel_id: int, overwrites: list)
|
||||||
user_ids: List[int] = []
|
user_ids: List[int] = []
|
||||||
|
|
||||||
for overwrite in overwrites:
|
for overwrite in overwrites:
|
||||||
|
|
||||||
# 0 for member overwrite, 1 for role overwrite
|
# 0 for member overwrite, 1 for role overwrite
|
||||||
target_type = 0 if overwrite["type"] == "member" else 1
|
target_type = 0 if overwrite["type"] == "member" else 1
|
||||||
target_role = None if target_type == 0 else overwrite["id"]
|
target_role = None if target_type == 0 else overwrite["id"]
|
||||||
|
|
|
||||||
|
|
@ -150,6 +150,7 @@ async def _specific_chan_create(channel_id, ctype, **kwargs):
|
||||||
|
|
||||||
|
|
||||||
async def _subscribe_users_new_channel(guild_id: int, channel_id: int) -> None:
|
async def _subscribe_users_new_channel(guild_id: int, channel_id: int) -> None:
|
||||||
|
|
||||||
# for each state currently subscribed to guild, we check on the database
|
# for each state currently subscribed to guild, we check on the database
|
||||||
# which states can also subscribe to the new channel at its creation.
|
# which states can also subscribe to the new channel at its creation.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -106,7 +106,6 @@ IDENTIFY_SCHEMA = {
|
||||||
"required": False,
|
"required": False,
|
||||||
"nullable": True,
|
"nullable": True,
|
||||||
},
|
},
|
||||||
"app_arch": {"type": "string", "required": False},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"capabilities": {"type": "number", "required": False},
|
"capabilities": {"type": "number", "required": False},
|
||||||
|
|
|
||||||
|
|
@ -552,6 +552,7 @@ class GuildMemberList:
|
||||||
|
|
||||||
# NOTE: maybe use map()?
|
# NOTE: maybe use map()?
|
||||||
for group, member_ids in self.list:
|
for group, member_ids in self.list:
|
||||||
|
|
||||||
# do not send information on groups
|
# do not send information on groups
|
||||||
# that don't have anyone
|
# that don't have anyone
|
||||||
if not member_ids:
|
if not member_ids:
|
||||||
|
|
|
||||||
|
|
@ -455,7 +455,6 @@ MESSAGE_CREATE = {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"flags": {"type": "number", "required": False},
|
"flags": {"type": "number", "required": False},
|
||||||
"mobile_network_type": {"type": "string", "required": False},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -225,7 +225,7 @@ async def maybe_lazy_guild_dispatch(
|
||||||
if isinstance(role, dict) and not role["hoist"] and not force:
|
if isinstance(role, dict) and not role["hoist"] and not force:
|
||||||
return
|
return
|
||||||
|
|
||||||
await getattr(app.lazy_guild, event)(guild_id, role)
|
await (getattr(app.lazy_guild, event))(guild_id, role)
|
||||||
|
|
||||||
|
|
||||||
def extract_limit(request_, default: int = 50, max_val: int = 100):
|
def extract_limit(request_, default: int = 50, max_val: int = 100):
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -9,15 +9,15 @@ license = "GPLv3-only"
|
||||||
python = "^3.9"
|
python = "^3.9"
|
||||||
bcrypt = "^4.0.1"
|
bcrypt = "^4.0.1"
|
||||||
itsdangerous = "^2.1.2"
|
itsdangerous = "^2.1.2"
|
||||||
asyncpg = "^0.29.0"
|
asyncpg = "^0.27.0"
|
||||||
websockets = "^12.0"
|
websockets = "^11.0.3"
|
||||||
Earl-ETF = "^2.1.2"
|
Earl-ETF = "^2.1.2"
|
||||||
logbook = "^1.5.3"
|
logbook = "^1.5.3"
|
||||||
Cerberus = "^1.3.5"
|
Cerberus = "^1.3.4"
|
||||||
quart = "^0.19.3"
|
quart = "^0.18.4"
|
||||||
pillow = "^10.1.0"
|
pillow = "^9.5.0"
|
||||||
aiohttp = "^3.9.0"
|
aiohttp = "^3.8.4"
|
||||||
zstandard = "^0.22.0"
|
zstandard = "^0.21.0"
|
||||||
winter = {git = "https://gitlab.com/elixire/winter"}
|
winter = {git = "https://gitlab.com/elixire/winter"}
|
||||||
wsproto = "^1.2.0"
|
wsproto = "^1.2.0"
|
||||||
|
|
||||||
|
|
|
||||||
5
run.py
5
run.py
|
|
@ -201,15 +201,12 @@ def set_blueprints(app_):
|
||||||
|
|
||||||
for bp, suffix in bps.items():
|
for bp, suffix in bps.items():
|
||||||
for prefix in PREFIXES:
|
for prefix in PREFIXES:
|
||||||
version = int(prefix.split("v")[1])
|
|
||||||
url_prefix = f'{prefix}{suffix or ""}'
|
url_prefix = f'{prefix}{suffix or ""}'
|
||||||
|
|
||||||
if suffix == -1:
|
if suffix == -1:
|
||||||
url_prefix = ""
|
url_prefix = ""
|
||||||
|
|
||||||
app_.register_blueprint(
|
app_.register_blueprint(bp, url_prefix=url_prefix)
|
||||||
bp, name=f"v{version}.{bp.name}", url_prefix=url_prefix
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
app = make_app()
|
app = make_app()
|
||||||
|
|
|
||||||
14
tox.ini
14
tox.ini
|
|
@ -5,13 +5,13 @@ isolated_build = true
|
||||||
[testenv]
|
[testenv]
|
||||||
ignore_errors = true
|
ignore_errors = true
|
||||||
deps =
|
deps =
|
||||||
pytest==7.4.3
|
pytest==7.1.2
|
||||||
pytest-asyncio==0.21.1
|
pytest-asyncio==0.19.0
|
||||||
pytest-cov==4.1.0
|
pytest-cov==3.0.0
|
||||||
flake8==6.1.0
|
flake8==5.0.4
|
||||||
black==23.11.0
|
black==22.6.0
|
||||||
mypy==1.7.0
|
mypy==0.971
|
||||||
pytest-instafail==0.5.0
|
pytest-instafail==0.4.2
|
||||||
commands =
|
commands =
|
||||||
python3 ./manage.py migrate
|
python3 ./manage.py migrate
|
||||||
black --check litecord run.py tests manage
|
black --check litecord run.py tests manage
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue