coupage de langue persifleuse

This commit is contained in:
François Poulain 2017-08-17 10:26:48 +02:00 committed by root
parent b91280c9e0
commit a690a9feb3
2 changed files with 3 additions and 4 deletions

3
bot.py
View File

@ -83,7 +83,8 @@ def join_irc(ircsock, botnick, channel):
def msg_handler(ircsock): # pragma: no cover (this excludes this function from testing) def msg_handler(ircsock): # pragma: no cover (this excludes this function from testing)
new_msg = ircsock.recv(2048) # receive data from the server new_msg = ircsock.recv(2048) # receive data from the server
new_msg = new_msg.strip('\n\r') # removing any unnecessary linebreaks new_msg = new_msg.strip('\n\r') # removing any unnecessary linebreaks
print(datetime.datetime.now().isoformat() + " " + new_msg) #### Potentially make this a log instead? if new_msg != '':
print(datetime.datetime.now().isoformat() + " " + new_msg) #### Potentially make this a log instead?
return new_msg return new_msg
# Called by bot on startup. Builds a regex that matches one of the options + (space) botnick. # Called by bot on startup. Builds a regex that matches one of the options + (space) botnick.

4
bot.sh
View File

@ -10,6 +10,4 @@ cd "$BINDIR"
#nohup /srv/welcomebot/git/bot.py >> /dev/null 2>>../welcomebot.log & #nohup /srv/welcomebot/git/bot.py >> /dev/null 2>>../welcomebot.log &
nohup "$BINDIR/bot.py" 2>&1 | grep -v "^$" >> "$HOMEDIR/welcomebot.log" & nohup "$BINDIR/bot.py" > /dev/null 2>>"$HOMEDIR/welcomebot.log" &