whatsapp.py 1.1 KB

123456789101112131415161718192021222324
  1. """``hermes whatsapp`` subcommand parser."""
  2. from __future__ import annotations
  3. from typing import Callable
  4. def build_whatsapp_parser(subparsers, *, cmd_whatsapp: Callable) -> None:
  5. """Attach the ``whatsapp`` subcommand to ``subparsers``."""
  6. whatsapp_parser = subparsers.add_parser(
  7. "whatsapp", help="Set up WhatsApp integration",
  8. description="Configure WhatsApp and pair via QR code")
  9. whatsapp_parser.set_defaults(func=cmd_whatsapp)
  10. def build_whatsapp_cloud_parser(subparsers, *, cmd_whatsapp_cloud: Callable) -> None:
  11. """Attach the ``whatsapp-cloud`` subcommand (official Meta Cloud API)."""
  12. whatsapp_cloud_parser = subparsers.add_parser(
  13. "whatsapp-cloud", help="Set up WhatsApp Business Cloud API integration",
  14. description="Configure the official Meta WhatsApp Business Cloud API "
  15. "adapter (Business account required, public webhook URL "
  16. "required). Distinct from `hermes whatsapp` which sets up "
  17. "the Baileys bridge for personal accounts.")
  18. whatsapp_cloud_parser.set_defaults(func=cmd_whatsapp_cloud)