コード例 #1
0
ファイル: addquote.py プロジェクト: wanshot/merlin
    def execute(self, message, user, params):

        params = params.group(1)
        params = self.timestampre.sub(' ', params).strip()

        session.add(Quote(text=params))
        session.commit()

        message.reply("Added your shitty quote: " + params)
コード例 #2
0
ファイル: quote.py プロジェクト: wanshot/merlin
    def execute(self, message, user, params):

        params = params.group(1)
        quote, count = Quote.search(params)
        reply = str(quote)
        if count < 1:
            reply = "No quotes matching '%s'" % (params, )
        if count > 1 and params:
            reply += " (%d more quotes match this search)" % (count - 1, )
        message.reply(reply)
コード例 #3
0
ファイル: quote.py プロジェクト: Hardware-Hacks/merlin
 def execute(self, message, user, params):
     
     params = params.group(1)
     quote, count = Quote.search(params)
     reply = str(quote)
     if count < 1:
         reply = "No quotes matching '%s'" % (params,)
     if count > 1 and params:
         reply+=" (%d more quotes match this search)" % (count - 1,)
     message.reply(reply)
コード例 #4
0
ファイル: remquote.py プロジェクト: Go3Media/merlin
 def execute(self, message, user, params):
     
     params = params.group(1)
     quote, count = Quote.search(params)
     if count < 1:
         reply = "No quotes matching '%s'" % (params,)
     if count > 1:
         reply = "There were %d quotes matching your search, I can only be bothered to delete one quote at a time you demanding f*****t" % (count,)
     if count == 1:
         session.delete(quote)
         session.commit()
         reply="Removed: '%s'" % (quote,)
     message.reply(reply)
コード例 #5
0
 def execute(self, message, user, params):
     
     params = params.group(1)
     quote, count = Quote.search(params)
     if count < 1:
         reply = "No quotes matching '%s'" % (params,)
     if count > 1:
         reply = "There were %d quotes matching your search, I can only be bothered to delete one quote at a time you demanding f*****t" % (count,)
     if count == 1:
         session.delete(quote)
         session.commit()
         reply="Removed: '%s'" % (quote,)
     message.reply(reply)