Updates get_help() function in 'virtual_fs' bot.
Update example commands from calling by keyword 'fs' (As was done previously) to calling by at-mention of the bot. Updates '/contrib_bots/bots/virtual_fs/virtual_fs.py' by correcting instructions on how to call 'virtual_fs' bot.
This commit is contained in:
parent
1991e0128b
commit
f33baacd02
|
@ -30,21 +30,21 @@ class TestVirtualFsBot(BotTestCase):
|
||||||
)
|
)
|
||||||
self.assert_bot_output(
|
self.assert_bot_output(
|
||||||
{'content': "help", 'type': "stream", 'display_recipient': "foo", 'subject': "foo", 'sender_email': "foo_sender@zulip.com"},
|
{'content': "help", 'type': "stream", 'display_recipient': "foo", 'subject': "foo", 'sender_email': "foo_sender@zulip.com"},
|
||||||
('foo_sender@zulip.com:\n\nThe "fs" commands implement a virtual file system for a stream.\n'
|
('foo_sender@zulip.com:\n\nThis bot implements a virtual file system for a stream.\n'
|
||||||
'The locations of text are persisted for the lifetime of the bot\n'
|
'The locations of text are persisted for the lifetime of the bot\n'
|
||||||
'running, and if you rename a stream, you will lose the info.\n'
|
'running, and if you rename a stream, you will lose the info.\n'
|
||||||
'Example commands:\n\n```\n'
|
'Example commands:\n\n```\n'
|
||||||
'fs sample_conversation: sample conversation with the bot\n'
|
'@mention-bot sample_conversation: sample conversation with the bot\n'
|
||||||
'fs mkdir: create a directory\n'
|
'@mention-bot mkdir: create a directory\n'
|
||||||
'fs ls: list a directory\n'
|
'@mention-bot ls: list a directory\n'
|
||||||
'fs cd: change directory\n'
|
'@mention-bot cd: change directory\n'
|
||||||
'fs pwd: show current path\n'
|
'@mention-bot pwd: show current path\n'
|
||||||
'fs write: write text\n'
|
'@mention-bot write: write text\n'
|
||||||
'fs read: read text\n'
|
'@mention-bot read: read text\n'
|
||||||
'fs rm: remove a file\n'
|
'@mention-bot rm: remove a file\n'
|
||||||
'fs rmdir: remove a directory\n'
|
'@mention-bot rmdir: remove a directory\n'
|
||||||
'```\n'
|
'```\n'
|
||||||
'Use commands like `fs help write` for more details on specific\ncommands.\n'),
|
'Use commands like `@mention-bot help write` for more details on specific\ncommands.\n'),
|
||||||
)
|
)
|
||||||
self.assert_bot_output(
|
self.assert_bot_output(
|
||||||
{'content': "help ls", 'type': "stream", 'display_recipient': "foo", 'subject': "foo", 'sender_email': "foo_sender@zulip.com"},
|
{'content': "help ls", 'type': "stream", 'display_recipient': "foo", 'subject': "foo", 'sender_email': "foo_sender@zulip.com"},
|
||||||
|
@ -52,19 +52,19 @@ class TestVirtualFsBot(BotTestCase):
|
||||||
)
|
)
|
||||||
self.assert_bot_output(
|
self.assert_bot_output(
|
||||||
{'content': "", 'type': "stream", 'display_recipient': "foo", 'subject': "foo", 'sender_email': "foo_sender@zulip.com"},
|
{'content': "", 'type': "stream", 'display_recipient': "foo", 'subject': "foo", 'sender_email': "foo_sender@zulip.com"},
|
||||||
('foo_sender@zulip.com:\n\nThe "fs" commands implement a virtual file system for a stream.\n'
|
('foo_sender@zulip.com:\n\nThis bot implements a virtual file system for a stream.\n'
|
||||||
'The locations of text are persisted for the lifetime of the bot\n'
|
'The locations of text are persisted for the lifetime of the bot\n'
|
||||||
'running, and if you rename a stream, you will lose the info.\n'
|
'running, and if you rename a stream, you will lose the info.\n'
|
||||||
'Example commands:\n\n```\n'
|
'Example commands:\n\n```\n'
|
||||||
'fs sample_conversation: sample conversation with the bot\n'
|
'@mention-bot sample_conversation: sample conversation with the bot\n'
|
||||||
'fs mkdir: create a directory\n'
|
'@mention-bot mkdir: create a directory\n'
|
||||||
'fs ls: list a directory\n'
|
'@mention-bot ls: list a directory\n'
|
||||||
'fs cd: change directory\n'
|
'@mention-bot cd: change directory\n'
|
||||||
'fs pwd: show current path\n'
|
'@mention-bot pwd: show current path\n'
|
||||||
'fs write: write text\n'
|
'@mention-bot write: write text\n'
|
||||||
'fs read: read text\n'
|
'@mention-bot read: read text\n'
|
||||||
'fs rm: remove a file\n'
|
'@mention-bot rm: remove a file\n'
|
||||||
'fs rmdir: remove a directory\n'
|
'@mention-bot rmdir: remove a directory\n'
|
||||||
'```\n'
|
'```\n'
|
||||||
'Use commands like `fs help write` for more details on specific\ncommands.\n'),
|
'Use commands like `@mention-bot help write` for more details on specific\ncommands.\n'),
|
||||||
)
|
)
|
||||||
|
|
|
@ -37,23 +37,23 @@ class VirtualFsHandler(object):
|
||||||
|
|
||||||
def get_help():
|
def get_help():
|
||||||
return '''
|
return '''
|
||||||
The "fs" commands implement a virtual file system for a stream.
|
This bot implements a virtual file system for a stream.
|
||||||
The locations of text are persisted for the lifetime of the bot
|
The locations of text are persisted for the lifetime of the bot
|
||||||
running, and if you rename a stream, you will lose the info.
|
running, and if you rename a stream, you will lose the info.
|
||||||
Example commands:
|
Example commands:
|
||||||
|
|
||||||
```
|
```
|
||||||
fs sample_conversation: sample conversation with the bot
|
@mention-bot sample_conversation: sample conversation with the bot
|
||||||
fs mkdir: create a directory
|
@mention-bot mkdir: create a directory
|
||||||
fs ls: list a directory
|
@mention-bot ls: list a directory
|
||||||
fs cd: change directory
|
@mention-bot cd: change directory
|
||||||
fs pwd: show current path
|
@mention-bot pwd: show current path
|
||||||
fs write: write text
|
@mention-bot write: write text
|
||||||
fs read: read text
|
@mention-bot read: read text
|
||||||
fs rm: remove a file
|
@mention-bot rm: remove a file
|
||||||
fs rmdir: remove a directory
|
@mention-bot rmdir: remove a directory
|
||||||
```
|
```
|
||||||
Use commands like `fs help write` for more details on specific
|
Use commands like `@mention-bot help write` for more details on specific
|
||||||
commands.
|
commands.
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue