-
Notifications
You must be signed in to change notification settings - Fork 3
/
__init__.py
63 lines (45 loc) · 1.95 KB
/
__init__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
from opsdroid.matchers import match_regex
import textwrap
@match_regex(r'reload')
async def reload(opsdroid, config, message):
await message.respond("Reloading skills")
await opsdroid.reload()
@match_regex(r'quit')
async def stop_opsdroid(opsdroid, config, message):
await message.respond("Stopping opsdroid")
opsdroid.exit()
@match_regex(r'help$')
async def help(opsdroid, config, message):
await message.respond(textwrap.dedent("""\
OpsDroid - An open source chat bot framework written in python.
OpsDroid comes with a few simple commands out of the box.
With "Hello" Opsdroid will greet users when they say hello.
With "Goodbye" Opsdroid will say goodbye to them when they leave.
With "when did you last see <user>" Opsdroid can tell you when the user was online.
With "ALLCAPSTEXT" Opsdroid will complain with an image.
With "Dance" Opsdroid will even dance!
To see a list of all active skills just say:
> help skills
You can also add more skills to Opsdroid by uncommenting or adding new skills to the configuration file.
A Configuration file can be found in:
Path: ~/.opsdroid/configuration.yaml
-------
Official site: https://opsdroid.github.io
Documentation files: http://opsdroid.readthedocs.io/en/latest/?badge=latest
Blog: https://medium.com/opsdroid
Youtube: https://www.youtube.com/channel/UC0FeGkDF7FrshmzAsb9lDvw
GitHub: https://github.com/opsdroid
Get opsdroid working on your computer:
Opsdroid Desktop: https://github.com/opsdroid/opsdroid-desktop
"""))
@match_regex(r'^help skill(.*?)$')
async def help_skill(opsdroid, config, message):
skill_names = {}
for i in range(len(opsdroid.skills)):
name = opsdroid.skills[i].config['name']
skill_names[name] = True
await message.respond("You have the following skills active: {}".format(list(skill_names.keys())))
@match_regex(r'clear$')
async def clear_screen(opsdroid, config, message):
"""Only works on the shell connector"""
await message.respond("\033c")