update post_connect to accept a /command to do things other than "msg"
these are just /msg and /mode for now, and the slash is retained out of convention Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
This commit is contained in:
parent
166b506843
commit
d0cbc815d1
@ -537,9 +537,13 @@ class IRCBot(irc.client.SimpleIRCClient):
|
||||
# run automsg commands
|
||||
if self.server_config.post_connect:
|
||||
for cmd in self.server_config.post_connect.split('\n'):
|
||||
cmd_split = cmd.split(' ')
|
||||
# TODO NOTE: if the bot is sending something that changes the vhost
|
||||
# (like 'hostserv on') we don't pick it up
|
||||
self.connection.privmsg(cmd.split(' ')[0], ' '.join(cmd.split(' ')[1:]))
|
||||
if cmd_split[0] == '/msg':
|
||||
self.connection.privmsg(cmd.split(' ')[1], ' '.join(cmd.split(' ')[2:]))
|
||||
elif cmd_split[0] == '/mode':
|
||||
self.connection.mode(*cmd_split[1:])
|
||||
|
||||
# sleep before doing autojoins
|
||||
time.sleep(self.server_config.delay_before_joins)
|
||||
|
Loading…
Reference in New Issue
Block a user