Thu, 15 Jan 2015 19:06:14 +0200
- added bridging functionality
65
20bd76353eb5
- modularized the configuration and made it more systematic
Teemu Piippo <crimsondusk64@gmail.com>
parents:
62
diff
changeset
|
1 | from modulecore import command_error |
20bd76353eb5
- modularized the configuration and made it more systematic
Teemu Piippo <crimsondusk64@gmail.com>
parents:
62
diff
changeset
|
2 | from configfile import Config |
62
052a8a1e3d7d
- revamped commands, added a much more modular system. not everything migrated yet
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
3 | import hgapi |
052a8a1e3d7d
- revamped commands, added a much more modular system. not everything migrated yet
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
4 | |
052a8a1e3d7d
- revamped commands, added a much more modular system. not everything migrated yet
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
5 | ModuleData = { |
052a8a1e3d7d
- revamped commands, added a much more modular system. not everything migrated yet
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
6 | 'commands': |
052a8a1e3d7d
- revamped commands, added a much more modular system. not everything migrated yet
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
7 | [ |
052a8a1e3d7d
- revamped commands, added a much more modular system. not everything migrated yet
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
8 | { |
052a8a1e3d7d
- revamped commands, added a much more modular system. not everything migrated yet
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
9 | 'name': 'addchan', |
052a8a1e3d7d
- revamped commands, added a much more modular system. not everything migrated yet
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
10 | 'description': 'Adds a channel to config', |
052a8a1e3d7d
- revamped commands, added a much more modular system. not everything migrated yet
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
11 | 'args': '<channel>', |
052a8a1e3d7d
- revamped commands, added a much more modular system. not everything migrated yet
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
12 | 'level': 'admin', |
052a8a1e3d7d
- revamped commands, added a much more modular system. not everything migrated yet
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
13 | }, |
052a8a1e3d7d
- revamped commands, added a much more modular system. not everything migrated yet
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
14 | |
052a8a1e3d7d
- revamped commands, added a much more modular system. not everything migrated yet
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
15 | { |
052a8a1e3d7d
- revamped commands, added a much more modular system. not everything migrated yet
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
16 | 'name': 'delchan', |
052a8a1e3d7d
- revamped commands, added a much more modular system. not everything migrated yet
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
17 | 'description': 'Deletes a channel from config', |
052a8a1e3d7d
- revamped commands, added a much more modular system. not everything migrated yet
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
18 | 'args': '<channel>', |
052a8a1e3d7d
- revamped commands, added a much more modular system. not everything migrated yet
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
19 | 'level': 'admin', |
052a8a1e3d7d
- revamped commands, added a much more modular system. not everything migrated yet
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
20 | }, |
052a8a1e3d7d
- revamped commands, added a much more modular system. not everything migrated yet
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
21 | ] |
052a8a1e3d7d
- revamped commands, added a much more modular system. not everything migrated yet
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
22 | } |
052a8a1e3d7d
- revamped commands, added a much more modular system. not everything migrated yet
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
23 | |
052a8a1e3d7d
- revamped commands, added a much more modular system. not everything migrated yet
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
24 | def cmd_addchan (bot, args, **rest): |
73
d67cc4fbc3f1
- modularization complete!!
Teemu Piippo <crimsondusk64@gmail.com>
parents:
65
diff
changeset
|
25 | bot.add_irc_channel (args['channel']) |
62
052a8a1e3d7d
- revamped commands, added a much more modular system. not everything migrated yet
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
26 | |
052a8a1e3d7d
- revamped commands, added a much more modular system. not everything migrated yet
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
27 | def cmd_delchan (bot, args, **rest): |
73
d67cc4fbc3f1
- modularization complete!!
Teemu Piippo <crimsondusk64@gmail.com>
parents:
65
diff
changeset
|
28 | bot.remove_irc_channel (args['channel']) |