Skip to content

Commit 9b3f012

Browse files
authored
🐛 fix state key bypassed
1 parent 63712dc commit 9b3f012

File tree

2 files changed

+13
-15
lines changed

2 files changed

+13
-15
lines changed

src/plugins/github/plugins/github_reply/content.py

+6-7
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@
2525
from src.plugins.github.helpers import NO_GITHUB_EVENT
2626
from src.plugins.github.libs.renderer import issue_to_image
2727
from src.plugins.github.libs.github import ISSUE_REGEX, FULLREPO_REGEX
28+
from src.plugins.github.dependencies import (
29+
ISSUE,
30+
OPTIONAL_REPLY_TAG,
31+
GITHUB_PUBLIC_CONTEXT,
32+
)
2833
from src.plugins.github.cache.message_tag import (
2934
IssueTag,
3035
PullRequestTag,
@@ -36,12 +41,6 @@
3641
TargetType,
3742
extract_sent_message,
3843
)
39-
from src.plugins.github.dependencies import (
40-
ISSUE,
41-
OPTIONAL_REPLY_TAG,
42-
GITHUB_PUBLIC_CONTEXT,
43-
bypass_key,
44-
)
4544

4645
content = on_command(
4746
"content",
@@ -79,7 +78,7 @@ async def parse_arg(
7978
)
8079

8180

82-
@content.handle(parameterless=(bypass_key("from_tag"),))
81+
@content.handle()
8382
async def check_issue(state: T_State, issue: ISSUE):
8483
state["issue_info"] = issue
8584
state["is_pr"] = bool(issue.pull_request)

src/plugins/github/plugins/github_reply/diff.py

+7-8
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
@Author : yanyongyu
33
@Date : 2021-03-26 14:59:59
44
@LastEditors : yanyongyu
5-
@LastEditTime : 2023-12-11 18:12:12
5+
@LastEditTime : 2023-12-15 10:37:34
66
@Description : None
77
@GitHub : https://github.com/yanyongyu
88
"""
@@ -26,18 +26,17 @@
2626
from src.plugins.github.libs.renderer import pr_diff_to_image
2727
from src.plugins.github.libs.github import ISSUE_REGEX, FULLREPO_REGEX
2828
from src.plugins.github.cache.message_tag import PullRequestTag, create_message_tag
29+
from src.plugins.github.dependencies import (
30+
ISSUE,
31+
OPTIONAL_REPLY_TAG,
32+
GITHUB_PUBLIC_CONTEXT,
33+
)
2934
from src.providers.platform import (
3035
TARGET_INFO,
3136
MESSAGE_INFO,
3237
TargetType,
3338
extract_sent_message,
3439
)
35-
from src.plugins.github.dependencies import (
36-
ISSUE,
37-
OPTIONAL_REPLY_TAG,
38-
GITHUB_PUBLIC_CONTEXT,
39-
bypass_key,
40-
)
4140

4241
diff = on_command(
4342
"diff",
@@ -72,7 +71,7 @@ async def parse_arg(
7271
await diff.finish("请发送要查看差异的 PR,例如:「/diff owner/repo#number」")
7372

7473

75-
@diff.handle(parameterless=(bypass_key("from_tag"),))
74+
@diff.handle()
7675
async def check_issue(state: T_State, issue: ISSUE):
7776
if not issue.pull_request:
7877
await diff.finish(

0 commit comments

Comments
 (0)