Skip to content

Commit a4f7503

Browse files
committed
refactor: convert Api port into instance attribute
1 parent 9f39362 commit a4f7503

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

wechatrobot/Api.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66
from wechatrobot import ChatRoomData_pb2 as ChatRoom
77

88
class Api:
9-
port : int = os.environ.get('WECHAT_HOOK_PORT', 18888)
10-
db_handle : Dict[str, int] = 0
9+
def __init__(self, port = 18888):
10+
self.port = port
11+
self.db_handle : Dict[str, int] = 0
1112

1213
def IsLoginIn(self , **params) -> Dict:
1314
return self.post(WECHAT_IS_LOGIN , IsLoginBody(**params))

0 commit comments

Comments
 (0)