diff --git a/README.rst b/README.rst index 21dfb02..756c578 100644 --- a/README.rst +++ b/README.rst @@ -41,6 +41,11 @@ Example:: #swift now discussing #glance support, come over! #swift next at 3pm we plan to cover cold storage features +You can also remove all entries related to your room by issuing the following +command:: + + #ROOMNAME clean + Admin commands ============== diff --git a/ptgbot/bot.py b/ptgbot/bot.py index 9b57c2f..55475ee 100644 --- a/ptgbot/bot.py +++ b/ptgbot/bot.py @@ -89,7 +89,8 @@ class PTGBot(irc.bot.SingleServerIRCBot): self.identify_msg_cap = True def usage(self, channel): - self.send(channel, "Format is '@ROOM [now|next] SESSION'") + self.send(channel, + "Format is '#ROOMNAME [ now ... | next ... | clean ]'") def send_room_list(self, channel): rooms = self.data.list_rooms() @@ -114,7 +115,8 @@ class PTGBot(irc.bot.SingleServerIRCBot): return words = msg.split() - if len(words) < 3: + if ((len(words) < 2) or + (len(words) == 2 and words[1].lower() != 'clean')): self.send(chan, "%s: Incorrect number of arguments" % (nick,)) self.usage(chan) return @@ -131,6 +133,8 @@ class PTGBot(irc.bot.SingleServerIRCBot): self.data.add_now(room, session) elif adverb == 'next': self.data.add_next(room, session) + elif adverb == 'clean': + self.data.clean_rooms([room]) else: self.send(chan, "%s: unknown directive '%s'" % (nick, adverb)) self.usage(chan)