本文整理汇总了Python中pipobot.lib.modules.SyncModule类的典型用法代码示例。如果您正苦于以下问题:Python SyncModule类的具体用法?Python SyncModule怎么用?Python SyncModule使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SyncModule类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, bot):
desc = "trac [num]\nListe les tickets trac actifs ou en affiche un en détail"
SyncModule.__init__(self,
bot,
desc=desc,
name="trac",
)
示例2: __init__
def __init__(self, bot):
desc = "getjid [nom]\nAffiche la première partie du jid pour découvrir qui se cache derrière un pseudo"
SyncModule.__init__(self,
bot,
desc = desc,
command = "getjid",
)
示例3: __init__
def __init__(self, bot):
desc = _("user: shows this help")
desc += _("\nuser register <args>: register user <pseudo> (defaults: you) with JID(s) <jid(s)> (defaults: your JID)")
desc += _("\nuser show: prints the whole Knows Users database")
desc += _("\nuser show <pseudo>: prints informations about <pseudo> (can also be 'me')")
desc += _("\nuser hllvl [<pseudo>]: prints the Highlight Level of <pseudo> (defaults: you)")
desc += _("\nuser hllvl [<pseudo>] <lvl>: sets the Highlight Level of <pseudo> (defaults: you) to <lvl>")
desc += _("\nuser permlvl [<pseudo>]: prints the Permission Level of <pseudo> (defaults: you)")
desc += _("\nuser permlvl [<pseudo>] <lvl>: sets the Permission Level of <pseudo> (defaults: you) to <lvl>")
desc += _("\nuser nick <pseudo>: sets your pseudo to <pseudo>")
SyncModule.__init__(self,
bot,
desc=desc,
command="user")
self.logger = logging.getLogger("pipobot.knownusers")
try:
for admin in self._settings["admins"]:
user = ''
if '@' in admin:
usersjid = bot.session.query(KnownUsersJIDs).filter(KnownUsersJIDs.jid == admin).first()
if usersjid:
user = usersjid.user
else:
self.logger.error(_('Admin %s is not yet registered !' % admin))
else:
user = bot.session.query(KnownUser).filter(KnownUser.pseudo == admin).first()
if user:
user.permlvl = 5
bot.session.commit()
else:
self.logger.error(_('Admin %s is not yet registered !' % admin))
except KeyError:
self.logger.error(_('You shall add an admin section in your configuration file'))
示例4: __init__
def __init__(self, bot):
desc = _("dok <query>: Search for <query> on the dokuwiki")
self.server_proxy = ServerProxy(self.url + '/lib/exe/xmlrpc.php?' + urlencode({'u': self.user, 'p': self.password}))
SyncModule.__init__(self,
bot,
desc=desc,
name="dok")
示例5: __init__
def __init__(self, bot):
desc = "score [module] [params]\nConsulte les scores pour le module [module]"
SyncModule.__init__(self,
bot,
desc,
"score",
)
self.avail_mods = {}
示例6: __init__
def __init__(self, bot):
desc = u"gore <pseudo>\nAjoute un point gore à <pseudo> (10 s minimum d'intervalle)"
SyncModule.__init__(self,
bot,
desc=desc,
pm_allowed=False,
name="gore",
)
示例7: __init__
def __init__(self, bot, desc, command, url_random, url_indexed, lock_time = 2):
SyncModule.__init__(self,
bot,
desc = desc,
command = command,
lock_time = lock_time,
)
self.url_random = url_random
self.url_indexed = url_indexed
示例8: __init__
def __init__(self, bot):
desc = """Rock Paper Scissors:
rps init <n> : lance une nouvelle partie avec <n> joueurs
rps bot : pour se mesurer au bot !!!
rps (Rock|Paper|Scissor) : pour jouer"""
SyncModule.__init__(self, bot, desc=desc, name="rps")
self.choices = ["Rock", "Paper", "Scissors"]
self.players = 0
self.manche = {}
self.bot.rps = self
示例9: __init__
def __init__(self, bot):
desc = {
"": u"Gestionnaire de dettes",
"add": u"""dette add [name1] [amount] [name2] [reason] : Ajoute une dette de [amount] que doit payer [name1] à [name2] à cause de [reason]
dette add [name1] [name2] [amount] [name3] [reason] : [name1] et [name2] doivent tous [amount] à [name3] à cause de [reason]""",
"multiple": u"dette multiple [name1] [name2] [amount] [name3] [reason] : [name1] et [name2] doivent se partager la dette [amount] à payer à [name3] à cause de [reason]",
"list": u"dette list [name] : Liste les dettes de [name1]",
"remove": u"dette remove [id1], [id2], [id3] : Supprime les dettes dont les id sont [id1], [id2], [id3]",
}
SyncModule.__init__(self, bot, desc=desc, name="dette")