2
0
mirror of https://github.com/Nick80835/microbot synced 2025-09-10 11:25:09 +00:00
Files
microbot/ubot/modules/howdoi.py

18 lines
416 B
Python
Raw Normal View History

2020-05-24 13:41:27 -04:00
# SPDX-License-Identifier: GPL-2.0-or-later
2020-05-24 13:59:52 -04:00
import re
2020-05-24 13:41:27 -04:00
from howdoi import howdoi
from ubot.micro_bot import micro_bot
ldr = micro_bot.loader
@ldr.add("hdi")
async def howdoi_cmd(event):
response = howdoi.howdoi(vars(howdoi.get_parser().parse_args(event.args.split(' '))))
2020-05-24 13:59:52 -04:00
response = re.sub(r'\n\n+', '\n\n', response).strip()
2020-05-24 13:48:03 -04:00
await event.reply(f"**Query:**\n{event.args}\n**Answer:**\n{response}")