summaryrefslogtreecommitdiff
path: root/ATRI/plugins/auto_tietie.py
diff options
context:
space:
mode:
authorKyomotoi <[email protected]>2022-10-17 23:46:00 +0800
committerKyomotoi <[email protected]>2022-10-17 23:46:00 +0800
commita8afa113cfef80237031916e20df44bc11df2270 (patch)
treec020a8eff1f024b1aa8ebc3fc4560246dd22fe06 /ATRI/plugins/auto_tietie.py
parent4adf588a06b1fb32c6e459dc6248b183313a241e (diff)
downloadATRI-a8afa113cfef80237031916e20df44bc11df2270.tar.gz
ATRI-a8afa113cfef80237031916e20df44bc11df2270.tar.bz2
ATRI-a8afa113cfef80237031916e20df44bc11df2270.zip
♻️ 跟进 service 的变化
Diffstat (limited to 'ATRI/plugins/auto_tietie.py')
-rw-r--r--ATRI/plugins/auto_tietie.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/ATRI/plugins/auto_tietie.py b/ATRI/plugins/auto_tietie.py
index 61f1370..177c2a9 100644
--- a/ATRI/plugins/auto_tietie.py
+++ b/ATRI/plugins/auto_tietie.py
@@ -1,12 +1,11 @@
from random import choice
-from nonebot.permission import SUPERUSER
from nonebot.adapters.onebot.v11 import MessageEvent
from nonebot.adapters.onebot.v11 import MessageSegment
from nonebot.adapters.onebot.v11.helpers import Cooldown
from ATRI.service import Service
-from ATRI.rule import is_in_service
+from ATRI.permission import MASTER
_is_tietie = True
@@ -29,7 +28,12 @@ _tietie_wd = choice(
]
)
-tt = Service("贴贴", "全自动贴贴机", True, is_in_service("贴贴"), permission=SUPERUSER)
+tt = (
+ Service("贴贴")
+ .document("全自动贴贴机")
+ .only_admin(True)
+ .permission(MASTER)
+)
auto_tietie = tt.on_message(
@@ -44,7 +48,7 @@ async def _(event: MessageEvent):
user_id = event.get_user_id()
at = MessageSegment.at(user_id)
- result = at + _tietie_wd
+ result = at + _tietie_wd # type: ignore
await auto_tietie.finish(result)