Example #1
0
 def command_rights(self, rest, nick, channel, user_host):
     if channel == "#cvn-staff" or (channel in self.oplist.keys() and (nick in self.oplist[channel] or nick in self.voicelist[channel])):
         try:
             wikilog.rights(rest, nick)
             return "Rights Log ( http://bit.ly/rightslog ), " + nick + "."
         except Exception, err:
             return "I failed :( [%s]" % err
Example #2
0
	def on_pubmsg(self, c, e):
		author,rest=e.source().split('!')
		line=e.arguments()[0]
		chan=self.channels[e.target()]
		if chan.is_voiced(author) or chan.is_oper(author):
			if line.startswith("!help"):
				c.privmsg(e.target(),self.msgs_help)
			if line.startswith("!info"):
				c.privmsg(e.target(),self.info_help)
			if line.startswith("!log "):
				undef,message=line.split(" ",1);
				try:
					wikilog.log(message,author)
					c.privmsg(e.target(),"Logged the message ( http://bit.ly/clogger ), "+author+".")
				except: c.privmsg(e.target(),"I failed :(")
			elif line.startswith("!rights "):
				undef,message=line.split(" ",1);
				try:
					wikilog.rights(message,author)
					c.privmsg(e.target(),"Rights log ( http://bit.ly/rightslog ) has been updated, "+author+".")
				except: c.privmsg(e.target(),"I failed :(")
			elif line.startswith("!disconnect"):
				 self.disconnect()
			elif line.startswith("!exit"):
				 self.die()
			elif line.startswith("!donick "):
				undef,message=line.split(" ",1);
				c.nick(message)
			elif line.startswith("!updatestatus "):
				undef,message=line.split(" ",1);
				try:
					self.currentstatus = message
					now=datetime.datetime.utcnow()
					self.statuslastmodtime = "%02d:%02d, %d %s %d" % ( now.hour, now.minute, now.day, self.monthsnames[now.month-1], now.year )
					self.statuslastmodauthor = author
					c.privmsg(e.target(),"Status updated, "+author+".")
				except:
					c.privmsg(e.target(), "Error updating status, "+author+".")
			elif line.startswith("!status"):
				c.privmsg(e.target(),"Status: "+self.currentstatus+" (Last modified by "+self.statuslastmodauthor+" at "+self.statuslastmodtime+")")
		else:
			if line.startswith("!status"):
				c.privmsg(e.target(),"Status: "+self.currentstatus+" (Last modified by "+self.statuslastmodauthor+" at "+self.statuslastmodtime+")")