diff --git a/plugins/News.py b/plugins/News.py index 4e23cb986..4faab3dcc 100644 --- a/plugins/News.py +++ b/plugins/News.py @@ -30,7 +30,8 @@ ### """ -Add the module docstring here. This will be used by the setup.py script. +A module to allow each channel to have "news" which people will be notified of +when they join the channel. News items may have expiration dates. """ from baseplugin import * @@ -41,7 +42,7 @@ import privmsgs import callbacks -def configure(onStart, afterConnect): +def configure(onStart, afterConnect, advanced): # This will be called by setup.py to configure this module. onStart and # afterConnect are both lists. Append to onStart the commands you would # like to be run when the bot is started; append to afterConnect the @@ -53,6 +54,7 @@ class News(callbacks.Privmsg, ChannelDBHandler): def __init__(self): ChannelDBHandler.__init__(self) callbacks.Privmsg.__init__(self) + self.removeOld = False def makeDb(self, filename): if os.path.exists(filename): @@ -63,11 +65,44 @@ class News(callbacks.Privmsg, ChannelDBHandler): id INTEGER PRIMARY KEY, item TEXT, added_at TIMESTAMP, + expires_at TIMESTAMP, added_by TEXT )""") db.commit() def addnews(self, irc, msg, args): + """[] + + Adds a given news item of to a channel. If isn't 0, + that news item will expire seconds from now. is + only necessary if the message isn't sent in the channel itself. + """ + pass + + def removenews(self, irc, msg, args): + """[] + + Removes the news item with id from . is + only necessary if the message isn't sent in the channel itself. + """ + pass + + def changenews(self, irc, msg, args): + """[] + + Changes the news item with id from according to the + regular expression . should be of the form + s/text/replacement/flags. is only necessary if the message + isn't sent on the channel itself. + """ + pass + + def oldnews(self, irc, msg, args): + """[] + + Returns the old news item for with id . + is only necessary if the message isn't sent in the channel itself. + """ pass Class = News