Beispiel #1
0
    def do_send(self, ch, user, groups):
        chunks = helper.sentence_to_chunks(groups[0].replace('jarvis', ''))

        chunks, reason = CashPoolHelper.extract_reason(chunks, word='sent')

        chunks = CashPoolHelper.fixup_receivers(
            self.send, ch, chunks, word='to')

        CashPoolHelper.do_transactions(
            self.send, ch, user, reason, chunks, REGEX_SENT_ONE)
Beispiel #2
0
    def do_send(self, ch, user, groups):
        chunks = helper.sentence_to_chunks(groups[0].replace('jarvis', ''))

        chunks, reason = CashPoolHelper.extract_reason(chunks, word='sent')

        chunks = CashPoolHelper.fixup_receivers(self.send,
                                                ch,
                                                chunks,
                                                word='to')

        CashPoolHelper.do_transactions(self.send, ch, user, reason, chunks,
                                       REGEX_SENT_ONE)
Beispiel #3
0
    def do_payment(self, ch, user, groups):
        chunks = helper.sentence_to_chunks(groups[0].replace('jarvis', ''))

        chunks, reason = CashPoolHelper.extract_reason(chunks, word='paid')

        # allow multiple receivers
        # NOTE: using 'for' interferes with reason extraction, this must not be
        # first
        chunks = CashPoolHelper.merge_nameonly_chunks(
            chunks, words=('paid', 'for'))

        chunks = CashPoolHelper.fixup_receivers(
            self.send, ch, chunks, word='for')

        CashPoolHelper.do_transactions(
            self.send, ch, user, reason, chunks, REGEX_PAID_ONE)
Beispiel #4
0
    def do_payment(self, ch, user, groups):
        chunks = helper.sentence_to_chunks(groups[0].replace('jarvis', ''))

        chunks, reason = CashPoolHelper.extract_reason(chunks, word='paid')

        # allow multiple receivers
        # NOTE: using 'for' interferes with reason extraction, this must not be
        # first
        chunks = CashPoolHelper.merge_nameonly_chunks(chunks,
                                                      words=('paid', 'for'))

        chunks = CashPoolHelper.fixup_receivers(self.send,
                                                ch,
                                                chunks,
                                                word='for')

        CashPoolHelper.do_transactions(self.send, ch, user, reason, chunks,
                                       REGEX_PAID_ONE)