From 4ad322b03087fb19257b4cab5bc16a0062350db3 Mon Sep 17 00:00:00 2001 From: "james.bertino" Date: Mon, 5 May 2014 17:57:46 -0400 Subject: [PATCH] Changed the return value of wait_time_change() to an int and updated the README. --- README.md | 2 +- bot.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c0ec230..fab5bf8 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ staying in touch bot.py is the project's main file. It uses the socket module to communicate and gathers a list of known IRC nicknames, stored in nicks.csv. Its basic functions include: -1. If someone enters the channel, the bot checks to see if they are a known nick. If not, it adds them to a list of people to greet. If no one else has spoken into the channel after 60 seconds, it greets them. If someone else (not the new nick) speaks into the channel within 60 seconds, or if the nick is known, the bot remains silent. The bots response text includes the nicks of channel maintainers/frequent contributors so that they are pinged. +1. If someone enters the channel, the bot checks to see if they are a known nick. If not, it adds them to a list of people to greet. If no one else has spoken into the channel after a period of time, 60 seconds by default, it greets them. If someone else (not the new nick) speaks into the channel within the set wait time, or if the nick is known, the bot remains silent. The bots response text includes the nicks of channel maintainers/frequent contributors so that they are pinged. Channel maintainers can change the wait time of the bot by using the following command in the irc channel: *Botname* --wait-time *new wait time in seconds*. 2. If someone says hello to the bot, the bot says hello back. 3. If someone asks the bot for information (via key phrases like "help", "faq", etc) the bot explains what it is and links to this repository. diff --git a/bot.py b/bot.py index 6dbe777..454a750 100644 --- a/bot.py +++ b/bot.py @@ -12,7 +12,7 @@ from threading import Thread from re import search # Some basic variables used to configure the bot. -server = "irc.freenode.net" +server = "irc.freenode.net" channel = "#openhatch" botnick = 'WelcomeBot' channel_greeters = ['shauna', 'paulproteus', 'marktraceur'] @@ -127,7 +127,7 @@ def wait_time_change(): .group()) ircsock.send("PRIVMSG {0} :{1} the wait time is changing to {2} " "seconds.\n".format(channel, actor, finder.group())) - return finder.group() + return int(finder.group()) ircsock.send("PRIVMSG {0} :{1} you are not authorized to make that " "change. Please contact one of the channel greeters, like {2}, for " "assistance.\n".format(channel, actor, greeter_string("or")))