Example #1
0
    def POST(self):
        data = web.input()
        token = data["token"]
        if team != token:
            return "Invalid team token."

        text = data["text"]
        command = text.split(" ")[0]

        if command == "":
            return "\n" + overview()

        if command == "import":
            type = text.split(" ")[1]

            if type == "channels":
                channels = insert_channels()
                return "{} channels uploaded".format(channels)
            elif type == "users":
                users = insert_users()
                return "{} users uploaded.".format(users)
            elif type == "channels-users":
                members = insert_channels_users()
                return "{} memberships uploaded.".format(members)
            else:
                return "No endpoint for inserting {} yet.".format(type)

        if command == "cypher":
            return cypher(text[7:])

        return "Unknown command: {}".format(command)
Example #2
0
    def POST(self):
        data = web.input()
        token = data["token"]
        if team != token:
            return "Invalid team token."

        text = data["text"]
        command = text.split(" ")[0]

        if command == "":
            return "\n" + overview()

        if command == "import":
            return insert()

        if command == "cypher":
            return cypher(text[7:])

        return "Unknown command: {}".format(command)
Example #3
0
    def POST(self):
        data = web.input()
        token = data["token"]
        if team != token:
            return "Invalid team token."

        text = data["text"]
        command = text.split(" ")[0]

        if command == "":
            return "\n" + overview()

        if command == "import":
            return insert()

        if command == "cypher":
            return cypher(text[7:])

        return "Unknown command: {}".format(command)