mirror of
https://github.com/suyiiyii/nonebot-bison.git
synced 2026-05-09 10:17:56 +08:00
⬆️ auto update by pre-commit hooks (#416)
* ⬆️ auto update by pre-commit hooks updates: - [github.com/astral-sh/ruff-pre-commit: v0.0.292 → v0.1.9](https://github.com/astral-sh/ruff-pre-commit/compare/v0.0.292...v0.1.9) - [github.com/pycqa/isort: 5.12.0 → 5.13.2](https://github.com/pycqa/isort/compare/5.12.0...5.13.2) - [github.com/psf/black: 23.9.1 → 23.12.1](https://github.com/psf/black/compare/23.9.1...23.12.1) - [github.com/pre-commit/mirrors-prettier: v3.0.3 → v4.0.0-alpha.8](https://github.com/pre-commit/mirrors-prettier/compare/v3.0.3...v4.0.0-alpha.8) - [github.com/pre-commit/mirrors-eslint: v8.50.0 → v9.0.0-alpha.0](https://github.com/pre-commit/mirrors-eslint/compare/v8.50.0...v9.0.0-alpha.0) * 💄 auto fix by pre-commit hooks --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
7aac4010e3
commit
f6ee4a4c1b
@@ -99,33 +99,27 @@ class Config(metaclass=Singleton):
|
||||
# update
|
||||
assert not isinstance(user_data, list)
|
||||
subs: list = user_data.get("subs", [])
|
||||
subs.append(
|
||||
{
|
||||
subs.append({
|
||||
"target": target,
|
||||
"target_type": target_type,
|
||||
"target_name": target_name,
|
||||
"cats": cats,
|
||||
"tags": tags,
|
||||
})
|
||||
self.user_target.update({"subs": subs}, query)
|
||||
else:
|
||||
# insert
|
||||
self.user_target.insert({
|
||||
"user": user,
|
||||
"user_type": user_type,
|
||||
"subs": [{
|
||||
"target": target,
|
||||
"target_type": target_type,
|
||||
"target_name": target_name,
|
||||
"cats": cats,
|
||||
"tags": tags,
|
||||
}
|
||||
)
|
||||
self.user_target.update({"subs": subs}, query)
|
||||
else:
|
||||
# insert
|
||||
self.user_target.insert(
|
||||
{
|
||||
"user": user,
|
||||
"user_type": user_type,
|
||||
"subs": [
|
||||
{
|
||||
"target": target,
|
||||
"target_type": target_type,
|
||||
"target_name": target_name,
|
||||
"cats": cats,
|
||||
"tags": tags,
|
||||
}
|
||||
],
|
||||
}
|
||||
)
|
||||
}],
|
||||
})
|
||||
self.update_send_cache()
|
||||
|
||||
def list_subscribe(self, user, user_type) -> list[SubscribeContent]:
|
||||
@@ -186,14 +180,12 @@ class Config(metaclass=Singleton):
|
||||
for user in self.user_target.all():
|
||||
for sub in user.get("subs", []):
|
||||
if sub.get("target_type") not in supported_target_type:
|
||||
to_del.append(
|
||||
{
|
||||
"user": user["user"],
|
||||
"user_type": user["user_type"],
|
||||
"target": sub["target"],
|
||||
"target_type": sub["target_type"],
|
||||
}
|
||||
)
|
||||
to_del.append({
|
||||
"user": user["user"],
|
||||
"user_type": user["user_type"],
|
||||
"target": sub["target"],
|
||||
"target_type": sub["target_type"],
|
||||
})
|
||||
continue
|
||||
res[sub["target_type"]][sub["target"]].append(User(user["user"], user["user_type"]))
|
||||
cat_res[sub["target_type"]][sub["target"]]["{}-{}".format(user["user_type"], user["user"])] = sub[
|
||||
|
||||
@@ -5,6 +5,7 @@ Revises:
|
||||
Create Date: 2022-03-21 19:18:13.762626
|
||||
|
||||
"""
|
||||
|
||||
import sqlalchemy as sa
|
||||
from alembic import op
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ Revises: c97c445e2bdb
|
||||
Create Date: 2022-03-27 21:50:10.911649
|
||||
|
||||
"""
|
||||
|
||||
import sqlalchemy as sa
|
||||
from alembic import op
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ Revises: 5f3370328e44
|
||||
Create Date: 2023-01-15 19:04:54.987491
|
||||
|
||||
"""
|
||||
|
||||
from alembic import op
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
|
||||
@@ -5,6 +5,7 @@ Revises: a333d6224193
|
||||
Create Date: 2022-05-31 22:05:13.235981
|
||||
|
||||
"""
|
||||
|
||||
import sqlalchemy as sa
|
||||
from alembic import op
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ Revises: aceef470d69c
|
||||
Create Date: 2023-03-20 00:39:30.199915
|
||||
|
||||
"""
|
||||
|
||||
import sqlalchemy as sa
|
||||
from alembic import op
|
||||
from sqlalchemy.dialects.postgresql import JSONB
|
||||
|
||||
@@ -5,6 +5,7 @@ Revises: a5466912fad0
|
||||
Create Date: 2023-03-20 11:08:42.883556
|
||||
|
||||
"""
|
||||
|
||||
import sqlalchemy as sa
|
||||
from alembic import op
|
||||
from sqlalchemy.dialects.postgresql import JSONB
|
||||
|
||||
@@ -5,6 +5,7 @@ Revises: 67c38b3f39c2
|
||||
Create Date: 2023-03-20 15:38:20.220599
|
||||
|
||||
"""
|
||||
|
||||
import sqlalchemy as sa
|
||||
from alembic import op
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ Revises: 4a46ba54a3f3
|
||||
Create Date: 2022-03-29 21:01:38.213153
|
||||
|
||||
"""
|
||||
|
||||
import sqlalchemy as sa
|
||||
from alembic import op
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ Revises: 632b8086bc2b
|
||||
Create Date: 2023-03-20 01:14:42.623789
|
||||
|
||||
"""
|
||||
|
||||
import sqlalchemy as sa
|
||||
from alembic import op
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
@@ -5,6 +5,7 @@ Revises: bd92923c218f
|
||||
Create Date: 2023-03-09 19:10:42.168133
|
||||
|
||||
"""
|
||||
|
||||
import sqlalchemy as sa
|
||||
from alembic import op
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ Revises: 5da28f6facb3
|
||||
Create Date: 2023-03-02 14:04:16.492133
|
||||
|
||||
"""
|
||||
|
||||
import sqlalchemy as sa
|
||||
from alembic import op
|
||||
from sqlalchemy import select
|
||||
|
||||
@@ -5,6 +5,7 @@ Revises: 0571870f5222
|
||||
Create Date: 2022-03-26 19:46:50.910721
|
||||
|
||||
"""
|
||||
|
||||
from alembic import op
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
|
||||
@@ -5,6 +5,7 @@ Revises: 8d3863e9d74b
|
||||
Create Date: 2023-08-25 00:20:51.511329
|
||||
|
||||
"""
|
||||
|
||||
import sqlalchemy as sa
|
||||
from alembic import op
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
""" 提供获取 Bot 的方法 """
|
||||
|
||||
from typing import Any
|
||||
from collections import defaultdict
|
||||
|
||||
|
||||
Reference in New Issue
Block a user