-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuiltins.lua
67 lines (58 loc) · 1.21 KB
/
builtins.lua
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
64
65
66
67
--[[
Copyright (c) 2014 Remko Tronçon
Licensed under the GNU General Public License v3.
See LICENSE for more information.
--]]
local swiftob = ...
swiftob.register_command({
name = 'quit',
allowed_role = 'owner',
description = 'Quit the bot',
callback = swiftob.quit
})
swiftob.register_command({
name = 'restart',
allowed_role = 'owner',
description = 'Restart bot',
callback = swiftob.restart
})
swiftob.register_command({
name = 'rehash',
allowed_role = 'owner',
description = 'Reload scripts',
callback = swiftob.reload
})
swiftob.register_command({
name = 'help',
description = 'Get help',
callback = function(command, parameters, message)
swiftob.reply_to(
message,
swiftob.command_descriptions_for_jid(message['from']),
message['type'] == 'groupchat')
end
})
swiftob.register_command({
name = 'join',
allowed_role = 'owner',
description = 'Join a MUC',
callback = function()
-- TODO
end
})
swiftob.register_command({
name = 'part',
allowed_role = 'owner',
description = 'Leave a MUC',
callback = function()
-- TODO
end
})
swiftob.register_command({
name = 'nick',
allowed_role = 'owner',
description = 'Change nick (requires restart)',
callback = function()
-- TODO
end
})