コード例 #1
0
def send_ping(message):
    logging.info("Pong!")
    bot.send_chat_action(message.chat.id, 'typing')

    info = get_runtime("botsrunner_yyets_1")
    redis = get_runtime("botsrunner_redis_1", "Redis")

    usage = ""
    if str(message.chat.id) == MAINTAINER:
        usage = show_usage()

    bot.send_message(message.chat.id, f"{info}\n{redis}\n\n{usage}", parse_mode='markdown')
コード例 #2
0
ファイル: bot.py プロジェクト: winkxx/YYeTsBot
def send_ping(message):
    logging.info("Pong!")
    bot.send_chat_action(message.chat.id, 'typing')

    info = get_runtime("botsrunner_yyets_1")
    redis = get_runtime("botsrunner_redis_1", "Redis")
    mongo = get_runtime("botsrunner_mongo_1", "MongoDB")

    usage = ""
    if str(message.chat.id) == MAINTAINER:
        usage = show_usage()
    announcement = redis_announcement() or ""
    if announcement:
        announcement = f"\n\n*公告:{announcement}*\n\n"
    bot.send_message(message.chat.id,
                     f"{info}\n{redis}\n{mongo}\n{usage}\n{announcement}",
                     parse_mode='markdown')
コード例 #3
0
def ping_handler(client: "Client", message: "types.Message"):
    chat_id = message.chat.id
    client.send_chat_action(chat_id, "typing")
    if os.uname().sysname == "Darwin":
        bot_info = "test"
    else:
        bot_info = get_runtime("botsrunner_ncmbot_1", "NCM Bot")
    client.send_message(chat_id, f"{bot_info}")
コード例 #4
0
ファイル: bot.py プロジェクト: wirenic/TeleTweet
def help_handler(message):
    bot.send_chat_action(message.chat.id, 'typing')

    try:
        userinfo = "Hello👋 " + get_me(message.chat.id) + "\n\n"
    except TypeError:
        userinfo = "Hello👋 unknown user! Want to `/sign_in` now?\n\n"

    info = get_runtime("botsrunner_teletweet_1")
    bot.send_message(message.chat.id,
                     userinfo + info,
                     parse_mode="markdown",
                     disable_web_page_preview=True)
コード例 #5
0
ファイル: ytdl.py プロジェクト: tgbot-collection/ytdl-bot
async def send_ping(event):
    async with bot.action(event.chat_id, 'typing'):
        bot_info = get_runtime("botsrunner_ytdl_1", "YouTube-dl")
        await bot.send_message(event.chat_id, f"{bot_info}\n", parse_mode='md')
        raise events.StopPropagation
コード例 #6
0
async def send_welcome(event):
    async with bot.action(event.chat_id, 'typing'):
        bot_info = get_runtime("botsrunner_ncmbot_1", "NCM Bot")
        await bot.send_message(event.chat_id, f"{bot_info}\n", parse_mode='md')
        raise events.StopPropagation
コード例 #7
0
ファイル: main.py プロジェクト: tgbot-collection/ExpressBot
def send_help(message):
    bot.send_chat_action(message.chat.id, 'typing')
    info = get_runtime("botsrunner_expressbot_1")
    bot.send_message(message.chat.id, info, parse_mode='markdown')