Files
zulip/zerver/management/commands/send_welcome_bot_message.py
Saubhagya Patel bb5c87e306 bots: Add a setting to customize the Welcome Bot message.
This commit includes the following changes:
- Add an administrator setting to customize the Welcome Bot
message when sending an invitation.
- Add an API endpoint to test the customized Welcome Bot message
by sending a copy of the message to the administrator.

Fixes #27663.

Co-authored-by: Akarsh Jain <akarsh.jain.790@gmail.com>
2025-08-08 18:59:37 -07:00

26 lines
859 B
Python

from argparse import ArgumentParser
from typing import Any
from typing_extensions import override
from zerver.lib.management import ZulipBaseCommand
from zerver.lib.onboarding import send_initial_direct_messages_to_user
class Command(ZulipBaseCommand):
help = """Sends the initial welcome bot message."""
@override
def add_arguments(self, parser: ArgumentParser) -> None:
self.add_user_list_args(
parser,
help="Email addresses of user(s) to send welcome bot messages to.",
all_users_help="Send to every user on the realm.",
)
self.add_realm_args(parser)
@override
def handle(self, *args: Any, **options: str) -> None:
for user_profile in self.get_users(options, self.get_realm(options), is_bot=False):
send_initial_direct_messages_to_user(user_profile)