Ejemplo n.º 1
0
    def _on_cmd_echo(self, e: Event, entity: str = '', args: str = '') -> None:
        if not args:
            text = f'Echo : ?'

            Channel.toRole(entity, Message.TEXT, text)
        else:
            text = f'Echo:{" ".join(args)}'

            role = Role.instance(entity)
            Channel.toRoom(role.room, Message.TEXT, text)
Ejemplo n.º 2
0
    def _on_cmd_say(
        self, e: Event, entity: str = '', args: List[str] = []
    ) -> None:
        if not args:
            text = f'你想說什麼?'

            Channel.toRole(entity, Message.TEXT, text)
        else:
            text = f'{Name.instance(entity).text} 說:{" ".join(args)}'

            role = Role.instance(entity)
            Channel.toRoom(role.room, Message.TEXT, text)
Ejemplo n.º 3
0
    def _on_cmd_time(
        self, e: Event, entity: str = '', args: List[str] = []

    ) -> None:
        localtime = time.asctime( time.localtime(time.time()) )
        if not args:
            text = f'現在時間為{" ".join(localtime)}'

            role = Role.instance(entity)
            Channel.toRoom(role.room, Message.TEXT, text)

        else:
            text = f'目前不支援參數請勿輸入任何數值'

            role = Role.instance(entity)
            Channel.toRole(entity, Message.TEXT, text)