Beispiel #1
0
 def __init__(self, bot):
     desc = _("wr in out expression: traduit [expression] de la langue [in] vers la langue [out]")
     SyncModule.__init__(self,
                         bot,
                         desc=desc,
                         name="wr")
     self.wordref = wrapi.WordRef()
Beispiel #2
0
    def __init__(self, bot):
        desc = _("dok <query>: Search for <query> on the dokuwiki")
        req_args = {'u': self.user, 'p': self.password}
        self.server_proxy = ServerProxy('%s/lib/exe/xmlrpc.php?%s' %
                                        (self.url, urlencode(req_args)))

        SyncModule.__init__(self, bot, desc=desc, name="dok")
Beispiel #3
0
 def __init__(self, bot):
     desc = u"mute [nom]\n[nom] ne peut plus parler sur le salon !!!"
     SyncModule.__init__(self,
                         bot,
                         name="mute",
                         pm_allowed=False,
                         desc=desc)
Beispiel #4
0
 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",
                         )
Beispiel #5
0
 def __init__(self, bot):
     desc = "exa [mots clefs]\nEffectue une recherche sur le web et affiche les 4 premiers résultats"
     SyncModule.__init__(self,
                         bot,
                         desc=desc,
                         name="exa",
                         )
Beispiel #6
0
 def __init__(self, bot):
     desc = "kick [nom]\nKick quelqu'un du salon !"
     SyncModule.__init__(self,
                         bot,
                         desc=desc,
                         name="kick",
                         pm_allowed=False)
Beispiel #7
0
    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'))
Beispiel #8
0
 def __init__(self, bot):
     desc = "Ta gueule [nom]\nDit taggle à nom (valeur par défaut à mettre dans le fichier de configuration)"
     SyncModule.__init__(self,
                         bot,
                         desc=desc,
                         name="tg",
                         )
Beispiel #9
0
 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",
                         )
Beispiel #10
0
 def __init__(self, bot):
     desc = _(
         "!s /<from>/<to>/ : Correct <from> in your last message by <to>\n")
     desc += _(
         "!s /<from>/<to>/ <someone> : Correct <from> in <someone> last message by <to>"
     )
     SyncModule.__init__(self, bot, desc=desc, name="s")
Beispiel #11
0
 def __init__(self, bot):
     desc = "Les insultes du capitaine haddock :p."
     SyncModule.__init__(self, bot, desc=desc, name="haddock")
     self.quotes = []
     path = os.path.join(os.path.dirname(__file__), "bdd.txt")
     with open(path, "r") as fichier:
         content = fichier.read()
         self.quotes = content.split("\n")
Beispiel #12
0
 def __init__(self, bot):
     desc = _(
         'fact <txt> [-<lang>]: find a fact with <txt> in <lang> on reverso.net'
     )
     SyncModule.__init__(self, bot, desc=desc, name='fact')
     # config: lang, size, fall
     self.last = self.fall
     self.buff = []
Beispiel #13
0
 def __init__(self, bot):
     desc = "Ta gueule [nom]\nDit taggle à nom (valeur par défaut à mettre dans le fichier de configuration)"
     SyncModule.__init__(
         self,
         bot,
         desc=desc,
         name="tg",
     )
Beispiel #14
0
    def __init__(self, bot):
        desc = """Correction orthographique
spell check : vérifie si un mot existe ou pas
spell suggest : donne les mots approchants"""
        SyncModule.__init__(self, 
                                bot,  
                                desc = desc,
                                command = "spell")
Beispiel #15
0
    def __init__(self, bot):
        desc = """hg : donne le dernier changement sur le repo %s
hg [repo] : donne le dernier changement du repo [repo]
hg [repo] [rev] : affiche la révision [rev] du repo [repo]""" % (self.default)
        SyncModule.__init__(self,
                            bot,
                            desc=desc,
                            name="hg")
Beispiel #16
0
    def __init__(self, bot):
        desc = u"""bourse [valeur [historique]]
Affiche le taux de conversion d'une valeur boursière.
Valeurs disponibles: %s""" % (', '.join(VALUES.keys()))
        SyncModule.__init__(self, 
                            bot, 
                            desc = desc,
                            command = "bourse")
Beispiel #17
0
 def __init__(self, bot):
     desc = "raced pseudo\nAjoute un point raced à /me envers pseudo"
     SyncModule.__init__(self,
                         bot,
                         desc=desc,
                         pm_allowed=False,
                         name="raced",
                         )
Beispiel #18
0
    def __init__(self, bot):
        desc = """Correction orthographique
spell check : vérifie si un mot existe ou pas
spell suggest : donne les mots approchants"""
        SyncModule.__init__(self,
                            bot,
                            desc=desc,
                            name="spell")
Beispiel #19
0
 def __init__(self, bot):
     desc = "xhtml code_xhtml\nAfficher le code xhtml formaté"
     SyncModule.__init__(self,
                         bot,
                         desc=desc,
                         pm_allowed=False,
                         name="xhtml",
                         )
Beispiel #20
0
 def __init__(self, bot):
     desc = "kick [nom]\nKick quelqu'un du salon !"
     SyncModule.__init__(self,
                         bot,
                         desc=desc,
                         name="kick",
                         pm_allowed=False
                         )
Beispiel #21
0
 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",
                         )
Beispiel #22
0
 def __init__(self, bot):
     desc = "score [module] [params]\nConsulte les scores pour le module [module]"
     SyncModule.__init__(self,
                         bot,
                         desc,
                         "score",
                         )
     self.avail_mods = {}
Beispiel #23
0
 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",
                         )
Beispiel #24
0
 def __init__(self, bot):
     desc = ("urban [result] [query] : displays the [result]-th response to the [query]\n"
             "urban : displays a random urban dictionary entry")
     SyncModule.__init__(self,
                         bot,
                         desc=desc,
                         name="urban")
     self._cache = deque()
Beispiel #25
0
 def __init__(self, bot):
     desc = (u"getjid [nom]\n"
             u"Affiche le jid pour découvrir qui se cache derrière un pseudo")
     SyncModule.__init__(self,
                         bot,
                         desc=desc,
                         name="getjid",
                         )
Beispiel #26
0
    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")
Beispiel #27
0
 def __init__(self, bot):
     desc = "exa [mots clefs]\nEffectue une recherche sur le web et affiche les 4 premiers résultats"
     SyncModule.__init__(
         self,
         bot,
         desc=desc,
         name="exa",
     )
Beispiel #28
0
 def __init__(self, bot):
     desc = _('fact <txt> [lang]: find a fact with <txt> (in [lang]) on reverso.net')
     SyncModule.__init__(self,
                         bot,
                         desc=desc,
                         name='fact')
     self.last = self.fall
     self.buff = []
Beispiel #29
0
 def __init__(self, bot):
     desc = "xhtml code_xhtml\nAfficher le code xhtml formaté"
     SyncModule.__init__(self, 
                         bot,  
                         desc = desc,
                         pm_allowed = False,
                         command = "xhtml",
                         )
Beispiel #30
0
    def __init__(self, bot):
        desc = """Commandline tips
cmdfu : Retourne une commande aléatoire"""
        SyncModule.__init__(self,
                            bot,
                            desc=desc,
                            name="cmdfu",
                            )
Beispiel #31
0
 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
Beispiel #32
0
    def __init__(self, bot):
        desc = """Rock Paper Scissors Lizard Spock:
rpsls init <someone> : Pour défier quelqu'un.
rpsls accept <someone> : Accèpte le défi de quelqu'un.
rpsls (Rock|Paper|Scissor|Lizard|Spock) : pour jouer"""
        SyncModule.__init__(self, bot, desc=desc, name="rpsls")
        self.p1 = None
        self.p2 = None
        self.running = False
Beispiel #33
0
    def __init__(self, bot):
        desc = _("dok <query>: Search for <query> on the dokuwiki")
        req_args = {'u': self.user, 'p': self.password}
        self.server_proxy = ServerProxy('%s/lib/exe/xmlrpc.php?%s' % (self.url, urlencode(req_args)))

        SyncModule.__init__(self,
                            bot,
                            desc=desc,
                            name="dok")
Beispiel #34
0
    def __init__(self, bot):
        desc = u"""Un superbe jeu de pendu
pendu init : lance une partie avec un mot aléatoire (to be coded...)
pendu init [word] : lance une partie avec 'word' comme mot à trouver
pendu reset : pour interrompre une partie en cours
pendu try [letter] : propose la lettre 'letter'
pendu played : affiche la liste des lettres déjà jouées"""
        SyncModule.__init__(self, bot, desc=desc, name="pendu")
        self.pendu = Pendu("")
Beispiel #35
0
    def __init__(self, bot):
        desc = """Le jugement des dieux !... Enfin de Pipo !
roll [entier] : renvoie un entier entre 1 et [entier]
roll [x,y,z] : renvoie un choix aléatoire entre x, y et z"""
        SyncModule.__init__(self,
                            bot,
                            desc=desc,
                            name="roll"
                            )
Beispiel #36
0
    def __init__(self, bot):
        desc = u"""tv
Donne les programmes tv de la soirée
Les chaînes disponibles sont les suivantes :
%s""" % (", ".join(sorted(extract(Requete.TNT).keys())))
        SyncModule.__init__(self,
                            bot,
                            desc=desc,
                            name="tv")
Beispiel #37
0
 def __init__(self, bot):
     desc = "score [module] [params]\nConsulte les scores pour le module [module]"
     SyncModule.__init__(
         self,
         bot,
         desc,
         "score",
     )
     self.avail_mods = {}
Beispiel #38
0
 def __init__(self, bot):
     desc = _("kickstarter : show this help\n")
     desc += _("kickstarter list: list known projects\n")
     desc += _("kickstarter all: show the status of all known projects\n")
     desc += _(
         "kickstarter add <project-owner>/<project-name>: add a project\n")
     desc += _("kickstarter rm <project-name>: remove a project\n")
     desc += _("kickstarter <project-name>: show the status of the project")
     SyncModule.__init__(self, bot, desc=desc, name="kickstarter")
Beispiel #39
0
 def __init__(self, bot):
     desc = "raced pseudo\nAjoute un point raced à /me envers pseudo"
     SyncModule.__init__(
         self,
         bot,
         desc=desc,
         pm_allowed=False,
         name="raced",
     )
Beispiel #40
0
    def __init__(self, bot):
        desc = """Commandline tips
cmdfu : Retourne une commande aléatoire"""
        SyncModule.__init__(
            self,
            bot,
            desc=desc,
            name="cmdfu",
        )
Beispiel #41
0
    def __init__(self, bot):
        desc = """Unicode caractère
    Affiche des informations sur le caractère unicode « caractère »
unicode nom
    Recherche le caractère unicode donc le nom ressemble à « nom »
"""
        SyncModule.__init__(self,   
                            bot, 
                            desc = desc,
                            command = "unicode")
Beispiel #42
0
 def __init__(self, bot):
     desc = _("date : show the actual date for the server and the sender\n")
     desc += _(
         "date set <timezone> : set your actual timezone (see http://pastebin.com/XbLSvZhY)\n"
     )
     desc += _("date all : show the actual date for all register users\n")
     desc += _(
         "date <timezone> : show the actual date and time for <timezone>")
     desc += _("date <user> : show the actual date and time for <user>")
     SyncModule.__init__(self, bot, desc=desc, name="date")
Beispiel #43
0
 def __init__(self, bot, desc, name, url_random, url_indexed, lock_time=2):
     SyncModule.__init__(
         self,
         bot,
         desc=desc,
         name=name,
         lock_time=lock_time,
     )
     self.url_random = url_random
     self.url_indexed = url_indexed
Beispiel #44
0
    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
Beispiel #45
0
    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
Beispiel #46
0
    def __init__(self, bot):
        desc = u"Le module du jeux des chiffres et des lettres\n"
        desc += u"lettres init : génère une nouvelle partie\n"
        desc += u"lettres solve : cherche à résoudre le problème"

        if self.dico == "":
            logger.error(_("Missing dictionary for lettres modules. " "Solving function will not work !"))

        self.game = Lettres(self.dico)
        SyncModule.__init__(self, bot, desc=desc, name="lettres")
Beispiel #47
0
    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")
Beispiel #48
0
 def __init__(self,
              bot,
              desc,
              command,
              pm_allowed=True,
              lock_time=0,
              delay=0):
     AsyncModule.__init__(self, bot, command, desc, delay)
     SyncModule.__init__(self, bot, desc, command, pm_allowed, lock_time)
     self._mute = True
Beispiel #49
0
 def __init__(self, bot):
     desc = _("date : show the actual date for the server and the sender\n")
     desc += _("date set <timezone> : set your actual timezone (see http://pastebin.com/XbLSvZhY)\n")
     desc += _("date all : show the actual date for all register users\n")
     desc += _("date <timezone> : show the actual date and time for <timezone>")
     desc += _("date <user> : show the actual date and time for <user>")
     SyncModule.__init__(self,
                         bot,
                         desc=desc,
                         name="date")
Beispiel #50
0
 def __init__(self, bot):
     desc = "Les insultes du capitaine haddock :p."
     SyncModule.__init__(self,
                         bot,
                         desc=desc,
                         name="haddock")
     self.quotes = []
     path = os.path.join(os.path.dirname(__file__), 'bdd.txt')
     with open(path, 'r') as fichier:
         content = fichier.read()
         self.quotes = content.split("\n")
Beispiel #51
0
    def __init__(self, bot):
        desc = u"Le module du jeux des chiffres et des lettres\n"
        desc += u"lettres init : génère une nouvelle partie\n"
        desc += u"lettres solve : cherche à résoudre le problème"

        if self.dico == "":
            logger.error(
                _("Missing dictionary for lettres modules. "
                  "Solving function will not work !"))

        self.game = Lettres(self.dico)
        SyncModule.__init__(self, bot, desc=desc, name="lettres")
 def __init__(self, bot, desc, name, autocongratulation, premier,
              operation):
     SyncModule.__init__(
         self,
         bot,
         desc=desc,
         pm_allowed=False,
         name=name,
     )
     self.autocongratulation = autocongratulation
     self.premier = premier  # S’utilise avec un %s pour le pseudo
     self.operation = operation
     self.init = self.operation(0, 1)
Beispiel #53
0
    def __init__(self, bot):
        desc = _(
            "hl <people>: Highligh <people> (whom can be registerd users, pseudos or list of people)"
        )
        desc += _(
            "\nhl <people> :<message>: Highligh <people>, and shows <message>")
        desc += _("\nhl show [<list>]: Shows list of people")
        desc += _("\nhl set|add <list> <people>: Add <people> to <list>")
        desc += _(
            "\nhl rm|del <list> [<people>]: Remove <list>, or <people> from <list>"
        )

        SyncModule.__init__(self, bot, desc=desc, name='hl')
Beispiel #54
0
    def __init__(self, bot):
        desc = """Unicode caractère
    Affiche des informations sur le caractère unicode « caractère »
unicode nom
    Recherche le caractère unicode donc le nom ressemble à « nom »
"""
        unicode_file = open(
            os.path.join(os.path.dirname(__file__), 'UnicodeDataLower.txt'))

        # unicode_file = open(os.path.join(config_dir, 'UnicodeDataLower.txt'))
        self.unicodes = [l.split(";")[0:2] for l in unicode_file]
        unicode_file.close()

        SyncModule.__init__(self, bot, desc=desc, name="unicode")
Beispiel #55
0
    def __init__(self, bot):
        desc = u"Le module du jeux des chiffres et des lettres\n"
        desc += u"chiffres init : génère une nouvelle partie\n"
        desc += u"chiffres solve : cherche à résoudre le problème"
        self.game = None
        SyncModule.__init__(self, bot, desc=desc, name="chiffres")

        # Activated printers and their names
        self.printers = {
            'br': ChiffresCmd.pretty_br,
            'lisp': ChiffresCmd.pretty_lisp,
            'tiles': ChiffresCmd.pretty_tiles
        }
        self.timer = None
Beispiel #56
0
    def __init__(self, bot):
        desc = {
            "":
            "Gestion des TODO-lists",
            "list":
            """todo list : affiche la liste des todolist existantes.
todo list [name] : affiche les todo de la liste [name]""",
            "add":
            "todo add [name] [msg] : crée le nouveau todo [msg] dans la liste [name]",
            "remove/delete/rm":
            "todo remove [n,...] : supprime les todos d'id [n,...]",
            "search":
            "todo search [element]: recherche un TODO qui contient [element]",
        }
        SyncModule.__init__(self, bot, desc=desc, name="todo")