Beispiel #1
0
def help_message(client: BaseClient):
    """「hato help」を見つけたら、使い方を表示する"""

    logger.debug("%s called 'hato help'", client.get_send_user())
    logger.debug("%s app called 'hato help'", client.get_type())
    str_help = [
        '',
        '使い方',
        '```',
        'amesh ... 東京のameshを表示する。',
        'amesh [text] ... 指定した地名・住所[text]のameshを表示する。',
        'amesh [緯度 (float)] [経度 (float)] ... 指定した座標([緯度 (float)], [経度 (float)])のameshを表示する。',
        '標高 ... 東京の標高を表示する。',
        '標高 [text] ... 指定した地名・住所[text]の標高を表示する。',
        '標高 [緯度 (float)] [経度 (float)] ... 指定した座標([緯度 (float)], [経度 (float)])の標高を表示する。',
        'eq ... 最新の地震情報を3件表示する。',
        'text list ... パワーワード一覧を表示する。 ',
        'text random ... パワーワードをひとつ、ランダムで表示する。 ',
        'text show [int] ... 指定した番号[int]のパワーワードを表示する。 ',
        'text add [text] ... パワーワードに[text]を登録する。 ',
        'text delete [int] ... 指定した番号[int]のパワーワードを削除する。 ',
        '>< [text] ... 文字列[text]を吹き出しで表示する。',
        'にゃーん ... 「よしよし」と返す。',
        'version ... バージョン情報を表示する。',
        '',
        '詳細はドキュメント(https://github.com/dev-hato/hato-bot/wiki)も見てくれっぽ!',
        '```'
    ]
    client.post(os.linesep.join(str_help))
Beispiel #2
0
def labotter_in(client: BaseClient):
    """らぼいん!"""

    msg = "らぼいんに失敗したっぽ!(既に入っているかもしれないっぽ)"
    user_id = client.get_send_user()
    flag, start_time = labo_in(user_id)
    if flag:
        msg = "らぼいんしたっぽ! \nいん時刻: {}".format(start_time)

    client.post(msg)
Beispiel #3
0
def labotter_rida(client: BaseClient):
    """らぼりだ!"""

    msg = "らぼりだに失敗したっぽ!"
    user_id = client.get_send_user()
    flag, end_time, datetime_second, sum_second = labo_rida(user_id)
    diff_time = datetime.timedelta(seconds=datetime_second)
    sum_time = datetime.timedelta(seconds=sum_second)
    if flag:
        msg = "らぼりだしたっぽ! お疲れ様っぽ!\nりだ時刻: {} \n拘束時間: {}\n累計時間: {}".format(
            end_time, diff_time, sum_time)

    client.post(msg)
Beispiel #4
0
def help_message(client: BaseClient):
    """「hato help」を見つけたら、使い方を表示する"""

    logger.debug("%s called 'hato help'", client.get_send_user())
    logger.debug("%s app called 'hato help'", client.get_type())
    str_help = '\n使い方\n'\
        '```'\
        '天気 [text] ... 地名の天気予報を表示する。\n'\
        'amesh ... ameshを表示する。\n'\
        'eq ... 最新の地震情報を3件表示する。\n'\
        'text list ... パワーワード一覧を表示する。 \n'\
        'text random ... パワーワードをひとつ、ランダムで表示する。 \n'\
        'text show [int] ... 指定した番号[int]のパワーワードを表示する。 \n'\
        'text add [text] ... パワーワードに[text]を登録する。 \n'\
        'text delete [int] ... 指定した番号[int]のパワーワードを削除する。 \n'\
        'in ... らぼいんする\n'\
        'rida ... らぼいんからの経過時間を表示する\n'\
        '>< [text] ... 文字列[text]を吹き出しで表示する。\n'\
        'version ... バージョン情報を表示する。\n'\
        '\n詳細はドキュメント(https://github.com/nakkaa/hato-bot/wiki)も見てくれっぽ!```\n'
    client.post(str_help)
Beispiel #5
0
def yoshiyoshi(client: BaseClient):
    """「にゃーん」を見つけたら、「よしよし」と返す"""

    logger.debug("%s called 'hato yoshiyoshi'", client.get_send_user())
    logger.debug("%s app called 'hato yoshiyoshi'", client.get_type())
    client.post('よしよし')