Skip to content

Commit

Permalink
Added new config option show_motd (True by default) which allows supp…
Browse files Browse the repository at this point in the history
…ression of MOTD messages.
  • Loading branch information
Paradox924X committed Jun 25, 2012
1 parent ef03f87 commit da2b14d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
11 changes: 6 additions & 5 deletions bot.py
Expand Up @@ -127,18 +127,19 @@ def user_join_channel(channel):

line = f.readline().rstrip()
while line:
if get_config_bool('show_timestamps'):
print '[' + str(datetime.datetime.now()) + '] ' + line
else:
print line
message_parts = line.split(' ')
if get_config_bool('show_motd') or len(message_parts) < 2 or message_parts[1] not in ['372','375','376']:
if get_config_bool('show_timestamps'):
print '[' + str(datetime.datetime.now()) + '] ' + line
else:
print line
if message_parts[0] == 'PING':
write('PONG ' + message_parts[1])
elif len(message_parts) > 4 and message_parts[3] == ':PING':
send_notice(get_nick(line), 'PONG ' + message_parts[4])
elif len(line.split(':')) > 2 and line.split(':')[2] == 'VERSION':
send_notice(get_nick(line), 'VERSION ' + VERSION + '')
elif message_parts[1] == '001':
elif len(message_parts) > 1 and message_parts[1] == '001':
user_identify()
user_set_modes(get_config('usermodes'))
for channel in get_config_list('channels'):
Expand Down
3 changes: 2 additions & 1 deletion server.cfg
@@ -1,8 +1,9 @@
[enigma-irc-bot]

; Application
show_timestamps = True
command_prefix = @
show_timestamps = True
show_motd = True

; Connection
hostname = irc.dairc.net
Expand Down

0 comments on commit da2b14d

Please sign in to comment.