Skip to content

Commit

Permalink
#83 思过崖
Browse files Browse the repository at this point in the history
  • Loading branch information
gakkiyomi committed Dec 5, 2023
1 parent 40d0984 commit f8d82fc
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/api/chatroom.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,16 @@ def open_rock_paper_scissors_redpacket(self, red_packet_id, gesture: int = -1) -
resp = requests.post(
f"{GLOBAL_CONFIG.host}/chat-room/red-packet/open", json=params, headers={'User-Agent': UA})
return json.loads(resp.text)

def siguoya(self) -> None:
resp = requests.get(
f"{GLOBAL_CONFIG.host}/chat-room/si-guo-list", headers={'User-Agent': UA})
ret = json.loads(resp.text)
if ('code' in ret and ret['code'] == -1):
print('思过崖空无一人')
else:
if len(ret['data']) == 0:
print('思过崖空无一人')
else:
print(
f'思过崖: {list(map(lambda x: x["userName"] ,ret["data"]))}')
6 changes: 6 additions & 0 deletions src/core/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ def exec(self, api: FishPi, args: Tuple[str, ...]):
cr.start()


class SiGuoYa(Command):
def exec(self, api: FishPi, args: Tuple[str, ...]):
api.chatroom.siguoya()


class AnswerMode(Command):
def exec(self, api: FishPi, args: Tuple[str, ...]):
if GLOBAL_CONFIG.chat_config.answer_mode:
Expand Down Expand Up @@ -328,6 +333,7 @@ def init_cli(api: FishPi):
cli_handler.add_command('#help', help_c)
cli_handler.add_command('#cli', EnterCil())
cli_handler.add_command('#chatroom', EnterChatroom())
cli_handler.add_command('#siguo', SiGuoYa())
cli_handler.add_command('#bm', BreezemoonsCommand())
cli_handler.add_command('#api-key', GetAPIKey())
cli_handler.add_command('#transfer', PointTransferCommand())
Expand Down
1 change: 1 addition & 0 deletions src/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
COMMAND_GUIDE = '''
[#cli] 进入命令交互模式
[#chatroom] 进入聊天室模式
[#siguo] 思过崖
[#rp] 1 128 1个128积分 (默认5个,128积分)拼手气红包
[#rp-ave] 1 128 1个128积分 (默认5个,32积分)平均红包
[#rp-hb] 5 128 5个128积分 (默认5个,32积分)心跳红包
Expand Down

0 comments on commit f8d82fc

Please sign in to comment.