diff --git a/frontend_tests/casper_tests/06-settings.js b/frontend_tests/casper_tests/06-settings.js index 4ab1061a42..b2984213bd 100644 --- a/frontend_tests/casper_tests/06-settings.js +++ b/frontend_tests/casper_tests/06-settings.js @@ -8,7 +8,7 @@ common.start_and_log_in(); // var form_sel = 'form[action^="/json/settings"]'; var regex_zuliprc = /^data:application\/octet-stream;charset=utf-8,\[api\]\nemail=.+\nkey=.+\nsite=.+\n$/; -var regex_flaskbotrc = /^data:application\/octet-stream;charset=utf-8,\[.\]\nemail=.+\nkey=.+\nsite=.+\n$/; +var regex_flaskbotrc = /^data:application\/octet-stream;charset=utf-8,\[\]\nemail=.+\nkey=.+\nsite=.+\n$/; casper.then(function () { var menu_selector = '#settings-dropdown'; diff --git a/frontend_tests/node_tests/settings_bots.js b/frontend_tests/node_tests/settings_bots.js index 7ef6b390dd..bc93f4cabf 100644 --- a/frontend_tests/node_tests/settings_bots.js +++ b/frontend_tests/node_tests/settings_bots.js @@ -52,7 +52,7 @@ run_test('generate_flaskbotrc_content', () => { api_key: "nSlA0mUm7G42LP85lMv7syqFTzDE2q34", }; var content = settings_bots.generate_flaskbotrc_content(user.email, user.api_key); - var expected = "[vabstest]\nemail=vabstest-bot@zulip.com\n" + + var expected = "[]\nemail=vabstest-bot@zulip.com\n" + "key=nSlA0mUm7G42LP85lMv7syqFTzDE2q34\n" + "site=https://chat.example.com\n"; diff --git a/static/js/settings_bots.js b/static/js/settings_bots.js index 8a13afa47b..4d2a8e5e96 100644 --- a/static/js/settings_bots.js +++ b/static/js/settings_bots.js @@ -110,12 +110,8 @@ exports.generate_zuliprc_content = function (email, api_key) { "\n"; }; -function bot_name_from_email(email) { - return email.substring(0, email.indexOf("-bot@")); -} - exports.generate_flaskbotrc_content = function (email, api_key) { - return "[" + bot_name_from_email(email) + "]" + + return "[]" + "\nemail=" + email + "\nkey=" + api_key + "\nsite=" + page_params.realm_uri + diff --git a/templates/zerver/api/deploying-bots.md b/templates/zerver/api/deploying-bots.md index 407c9490dd..6b1964560b 100644 --- a/templates/zerver/api/deploying-bots.md +++ b/templates/zerver/api/deploying-bots.md @@ -62,7 +62,7 @@ pip install zulip_botserver 1. Open the `flaskbotrc`. It should contain one or more sections that look like this: ``` - [foo] + [] email=foo-bot@hostname key=dOHHlyqgpt5g0tVuVl6NHxDLlc9eFRX4 site=http://hostname