summaryrefslogtreecommitdiff
path: root/ATRI/plugins/auto_tietie.py
diff options
context:
space:
mode:
authorKyomotoi <[email protected]>2022-11-04 08:52:56 +0800
committerKyomotoi <[email protected]>2022-11-04 08:52:56 +0800
commitdddc29b9c18b9d646ff18144094584e2badbe384 (patch)
tree1f0ee0b0f48481316bc4d7f0a3383655e125c02d /ATRI/plugins/auto_tietie.py
parent1b211c3a9a882935c1653d2ce1a8f73ea9ea90f8 (diff)
downloadATRI-dddc29b9c18b9d646ff18144094584e2badbe384.tar.gz
ATRI-dddc29b9c18b9d646ff18144094584e2badbe384.tar.bz2
ATRI-dddc29b9c18b9d646ff18144094584e2badbe384.zip
🎨 跟随底层的更改, 规范代码风格
Diffstat (limited to 'ATRI/plugins/auto_tietie.py')
-rw-r--r--ATRI/plugins/auto_tietie.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/ATRI/plugins/auto_tietie.py b/ATRI/plugins/auto_tietie.py
index 0f78459..a88760e 100644
--- a/ATRI/plugins/auto_tietie.py
+++ b/ATRI/plugins/auto_tietie.py
@@ -8,8 +8,8 @@ from ATRI.service import Service
from ATRI.permission import MASTER
-_is_tietie = True
-_tietie_wd = choice(
+__TIETIE_ENABLED = True
+__TIETIE_WORDS = choice(
[
"mua!",
"贴贴!",
@@ -28,40 +28,40 @@ _tietie_wd = choice(
]
)
-tt = Service("贴贴").document("全自动贴贴机").only_admin(True).permission(MASTER)
+plugin = Service("贴贴").document("全自动贴贴机").permission(MASTER)
-auto_tietie = tt.on_message(
+auto_tietie = plugin.on_message(
"贴贴w", "只与维护者贴贴w, '不可以贴'以拒绝贴贴~, '来贴贴'以接受贴贴~", block=False, priority=11
)
@auto_tietie.handle([Cooldown(600)])
async def _(event: MessageEvent):
- if not _is_tietie:
+ if not __TIETIE_ENABLED:
await auto_tietie.finish()
user_id = event.get_user_id()
at = MessageSegment.at(user_id)
- result = at + _tietie_wd # type: ignore
+ result = at + __TIETIE_WORDS # type: ignore
await auto_tietie.finish(result)
-no_tietie = tt.on_command("不可以贴", docs="拒绝贴贴")
+no_tietie = plugin.on_command("不可以贴", docs="拒绝贴贴")
@no_tietie.handle()
async def _():
- global _is_tietie
- _is_tietie = False
+ global __TIETIE_ENABLED
+ __TIETIE_ENABLED = False
await no_tietie.finish("好吧...")
-yes_tietie = tt.on_command("来贴贴", docs="继续贴贴")
+yes_tietie = plugin.on_command("来贴贴", docs="继续贴贴")
@yes_tietie.handle()
async def _():
- global _is_tietie
- _is_tietie = True
+ global __TIETIE_ENABLED
+ __TIETIE_ENABLED = True
await yes_tietie.finish("好欸!")