summaryrefslogtreecommitdiff
path: root/ATRI/plugins/curse.py
diff options
context:
space:
mode:
authorLint Action <[email protected]>2021-07-08 14:09:51 +0000
committerLint Action <[email protected]>2021-07-08 14:09:51 +0000
commit951dcdf4ec224b31433c5ab5c170b76fd3087910 (patch)
treefe0ee2b5c219bd8f9796917ac3ee6286d4181146 /ATRI/plugins/curse.py
parentbe2747e4d4b820ca0f1f988d3b77a628da26fe7b (diff)
downloadATRI-951dcdf4ec224b31433c5ab5c170b76fd3087910.tar.gz
ATRI-951dcdf4ec224b31433c5ab5c170b76fd3087910.tar.bz2
ATRI-951dcdf4ec224b31433c5ab5c170b76fd3087910.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)