Purple exclamation mark.svg Planning the future of Botwiki! - Help us bring Botwiki up to date, contribute to our strategy discussion, add bot scripts, and contribute manuals, guides, and tutorials! Almost anything related to bots, particularly those used to edit mediawiki, is welcome.

Red exclamation mark.svg UNABLE TO EDIT? - We've experienced attacks by spambots lately and now require you to confirm your e-mail before you can edit (go to your preferences, enter an e-mail address, and request a confirmation e-mail, then go to your e-mail and click on the confirmation link). We also require new accounts to make a few edits and wait a few minutes before before you can create a page; however, if this is a problem contact us in #botwiki and we can manually confirm your account. Sorry for the inconvenience.

Python:BotSottile/help.py

From Botwiki
Jump to: navigation, search
#!/usr/bin/env python
# -*- coding: cp1252 -*-
"""
help.py - Help Facilities
Author: Sean B. Palmer, inamidst.com
About: http://inamidst.com/phenny/
"""
 
def f_chelp(self, origin, match, args): 
   command = match.group(1).rstrip('?!')
   if self.doc.has_key('f_' + command): 
      self.msg(origin.sender, '%r' % self.doc['f_' + command])
   elif self.doc.has_key(command): 
      self.msg(origin.sender, '%r' % self.doc[command])
   else: self.msg(origin.sender, "Sorry, no documentation for %s." % command)
 
def f_help(self, origin, match, args): 
   if (not args[0].startswith(self.nick)) and origin.sender.startswith('#'): 
      return
 
#   if match.group(1): 
#      f_chelp(self, origin, match, args)
#      return
   result = ["Ciao, Sono %s" % self.nick]
 
##   keys = []
##   for key in sorted(self.doc.keys()): 
##      if key.startswith('f_'): 
##         key = key[2:]
##      keys.append(key)
 
##   result.append('Moduli: ' + ', '.join(keys))
   result.append('Puoi trovare una guida ai miei comandi su http://botwiki.sno.cc/wiki/Python:BotSottile/Guida')
   result.append('Il mio owner è %s, l\'alternate è %s.' % (self.config.owner, self.config.alternate))
   result.append('Per problemi, prima di kickare il bot, puoi contattare anche: ' + ', '.join(self.config.closers))
   result.append('Sono attivo sui canali: ' + ', '.join(self.config.channels))
   self.msglines(origin.sender, result)
f_help.rule = ('$nick', ['help'])
 
#
Personal tools
Share