summaryrefslogtreecommitdiff
path: root/ATRI/plugins/curse.py
diff options
context:
space:
mode:
authorLint Action <[email protected]>2021-07-31 08:17:46 +0000
committerLint Action <[email protected]>2021-07-31 08:17:46 +0000
commit36d26d1dc61c36b4601aaf75e148060c5bcb98a7 (patch)
tree3b466c4b0db4b9e160c5390a1d1c7ddb0322660f /ATRI/plugins/curse.py
parent336eb9d9e98b0bee952c27a50820dbdb350bcc03 (diff)
downloadATRI-36d26d1dc61c36b4601aaf75e148060c5bcb98a7.tar.gz
ATRI-36d26d1dc61c36b4601aaf75e148060c5bcb98a7.tar.bz2
ATRI-36d26d1dc61c36b4601aaf75e148060c5bcb98a7.zip
:rotating_light: 自动进行代码格式化
Diffstat (limited to 'ATRI/plugins/curse.py')
-rw-r--r--ATRI/plugins/curse.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/ATRI/plugins/curse.py b/ATRI/plugins/curse.py
index b2dbc05..edd6249 100644
--- a/ATRI/plugins/curse.py
+++ b/ATRI/plugins/curse.py
@@ -20,10 +20,9 @@ __doc__ = """
class Curse(Service):
-
def __init__(self):
Service.__init__(self, "口臭", __doc__, rule=is_in_service("口臭"))
-
+
@staticmethod
async def now() -> str:
res = await request.get(URL)
@@ -31,14 +30,17 @@ class Curse(Service):
return result
-normal_curse = Curse().on_command("口臭一下", "主命令,骂你一下", aliases={"骂我", "口臭"}, rule=to_bot())
+normal_curse = Curse().on_command(
+ "口臭一下", "主命令,骂你一下", aliases={"骂我", "口臭"}, rule=to_bot()
+)
+
@normal_curse.handle()
async def _deal_n_curse(bot: Bot, event: MessageEvent):
user_id = event.get_user_id()
if not _curse_flmt.check(user_id):
await normal_curse.finish(_curse_flmt_notice)
-
+
result = await Curse().now()
_curse_flmt.start_cd(user_id)
await normal_curse.finish(result)
@@ -46,12 +48,13 @@ async def _deal_n_curse(bot: Bot, event: MessageEvent):
super_curse = Curse().on_regex(r"[来求有](.*?)骂我吗?", "有求必应")
+
@super_curse.handle()
async def _deal_s_curse(bot: Bot, event: MessageEvent):
user_id = event.get_user_id()
if not _curse_flmt.check(user_id):
await normal_curse.finish(_curse_flmt_notice)
-
+
result = await Curse().now()
_curse_flmt.start_cd(user_id)
await normal_curse.finish(result)