Customize the manifest template with the chosen bot name and command.
(
manifest_str: str, app_name: str, display_name: str, slash_command: str
)
| 90 | |
| 91 | |
| 92 | def customize_manifest( |
| 93 | manifest_str: str, app_name: str, display_name: str, slash_command: str |
| 94 | ) -> str: |
| 95 | """Customize the manifest template with the chosen bot name and command.""" |
| 96 | manifest = json.loads(manifest_str) |
| 97 | manifest["display_information"]["name"] = app_name |
| 98 | manifest["features"]["bot_user"]["display_name"] = display_name |
| 99 | for cmd in manifest.get("features", {}).get("slash_commands", []): |
| 100 | if cmd.get("command") == "/agent": |
| 101 | cmd["command"] = slash_command |
| 102 | return json.dumps(manifest, indent=2) |
| 103 | |
| 104 | |
| 105 | def validate_bot_token(token: str) -> tuple[bool, str]: |