Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
N
nil2bot
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Iori Ichinose
nil2bot
Commits
64a6fe16
Commit
64a6fe16
authored
3 years ago
by
Iori Ichinose
Browse files
Options
Downloads
Patches
Plain Diff
remove b30
parent
f830e788
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/plugins/arc/api.py
+3
-4
3 additions, 4 deletions
src/plugins/arc/api.py
src/plugins/arc/query.py
+6
-2
6 additions, 2 deletions
src/plugins/arc/query.py
with
9 additions
and
6 deletions
src/plugins/arc/api.py
+
3
−
4
View file @
64a6fe16
...
...
@@ -22,19 +22,18 @@ async def fetch_api(
data
=
await
conn
.
recv
()
if
isinstance
(
data
,
str
)
and
data
==
'
bye
'
:
break
el
if
isinstance
(
data
,
(
bytes
,
bytearray
)):
if
isinstance
(
data
,
(
bytes
,
bytearray
)):
message
=
json
.
loads
(
brotli
.
decompress
(
data
))
print
(
message
)
print
(
message
[
'
cmd
'
]
)
if
message
[
'
cmd
'
]
==
query_type
:
if
type
(
message
[
'
data
'
])
is
list
:
for
item
in
message
[
'
data
'
]:
ret
.
append
(
item
)
else
:
ret
.
append
(
message
[
'
data
'
])
print
(
ret
)
return
ret
if
__name__
==
'
__main__
'
:
import
asyncio
asyncio
.
run
(
fetch_api
(
'
295917349
'
,
'
userinfo
'
))
\ No newline at end of file
asyncio
.
run
(
fetch_api
(
'
295917349
'
,
'
scores
'
))
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/plugins/arc/query.py
+
6
−
2
View file @
64a6fe16
...
...
@@ -69,7 +69,7 @@ async def fetch_b30_list(user_code: str) -> list[Song]:
async
def
fetch_userinfo
(
user_code
:
str
)
->
User
:
info
=
await
fetch_api
(
user_code
,
'
userinfo
'
,
start
=
8
,
end
=
12
)
info
=
await
fetch_api
(
user_code
,
'
userinfo
'
)
if
len
(
info
)
==
0
:
raise
RuntimeError
return
User
(
info
[
0
])
...
...
@@ -153,8 +153,12 @@ async def set_arc(event: Event, params: tuple[int]) -> str:
async
def
fetch_b30
(
event
:
Event
,
params
)
->
MessageSegment
:
return
CQGen
.
face
(
'
kk
'
)
+
CQGen
.
text
(
'
b30功能坏掉惹
'
)
user_id
=
event
.
dict
()[
'
user_id
'
]
user_code
=
users
[
str
(
user_id
)]
kid
=
str
(
user_id
)
if
kid
not
in
users
:
return
CQGen
.
face
(
'
daisuke
'
)
+
"
椰叶还没有绑定好友码哦
"
user_code
=
users
[
kid
]
try
:
songs
=
await
fetch_b30_list
(
user_code
=
user_code
)
ret
=
handle_songs
(
songs
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment