def _on_cmd_say(self, e: Event, entity: str = '', args: List[str] = []) -> None: if not args: text = f'你想說什麼?' Channel.to_role(entity, Message.TEXT, text) else: text = f'{Name.instance(entity).text} 說:{" ".join(args)}' role = Role.instance(entity) Channel.to_room(role.room, Message.TEXT, text)
def _on_cmd_say( self, e: Event, entity: str = '', args: Sequence[str] = [] ) -> None: if not args: text = f' 你想說什麼?' Channel.to_role(entity, Message.TEXT, text) else: role = Stats.text('binding', entity) room = Stats.text('at_room', role) text = f'{Stats.text("name", role)} ({Stats.text("tag", role)}) 說:{" ".join(args)}' Channel.to_room(room, Message.TEXT, text)
def _on_cmd_exit(self, e: Event, entity: str = '', args: List[str] = []) -> None: luckynumber = random.randint(0, 100) if args: text = f'請不要輸入參數' Channel.to_role(entity, Message.TEXT, text) else: text = f'{Name.instance(entity).text} 的幸運數字{" ".join(str(luckynumber))}請記住這個號碼' role = Role.instance(entity) Channel.to_room(role.room, Message.TEXT, text)