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')
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')
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}")
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)
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
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
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')