Skip to content

Commit cfa2a68

Browse files
fix: 修复车站 api 非正常调用致命错误
1 parent a977d19 commit cfa2a68

3 files changed

Lines changed: 7 additions & 6 deletions

File tree

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setup(
77
name='tsugu-api-python',
8-
version='1.5.8',
8+
version='1.5.9',
99
author='WindowsSov8',
1010
author_email='qwertyuiop2333@hotmail.com',
1111
description='Tsugu BanGDream Bot 的功能 API 统合包',

tsugu_api/_bandoristation.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,14 @@ def submit_room_number(number: int, user_id: str, raw_message: str, source: str,
2525
'user_id': user_id,
2626
'raw_message': raw_message,
2727
'source': source,
28-
'token': token
28+
'token': token,
29+
'function': 'submit_room_number',
2930
}
3031

3132
# 发送请求
3233
response = Api(
3334
BANDORI_STATION_URL,
34-
'submit_room_number',
35+
'',
3536
proxy=settings.backend_proxy
3637
).get(params).json()
3738
if response['status'] == 'failure':
@@ -47,9 +48,9 @@ def query_room_number() -> List[StationRoom]:
4748
# 发送请求
4849
response = Api(
4950
BANDORI_STATION_URL,
50-
'query_room_number',
51+
'',
5152
proxy=settings.backend_proxy
52-
).get().json()
53+
).get({'function': 'query_room_number'}).json()
5354
if response['status'] == 'failure':
5455
raise RoomQueryFailure(response['response'])
5556
return response['response']

tsugu_api_core/_network.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from .client import _Client, Request, Response
88
from .exception import BadRequestError, FailedException, HTTPStatusError
99

10-
BANDORI_STATION_URL = 'https://api.bandoristation.com/'
10+
BANDORI_STATION_URL = 'https://api.bandoristation.com'
1111

1212
# 向后端发送 API 请求类
1313
class Api:

0 commit comments

Comments
 (0)