CHRISTIANA JOHNT RUTH PUSHPA LATHA
Created December 17, 2016

True Friend Holy Spirit

A skill that teaches about the Holy Spirit who is the BEST HELP available to everyonwe.Learn more about what the Holy SPIRIT.

31
True Friend Holy Spirit

Things used in this project

Story

Read more

Schematics

User Flow

Code

AlexaSkill

JavaScript
/**Jesus is Lord*//**    Copyright CHRISTIANA JOHN. All Rights Reserved.    Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. A copy of the License is located in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES ORCONDITIONSOFANYKIND,eitherexpress or implied. See the License for the specific language governing permissions and limitationsunder the License.*/'use strict';function AlexaSkill(appId) {    this._appId = appId;}AlexaSkill.speechOutputType = {    PLAIN_TEXT: 'PlainText',    SSML: 'SSML'}AlexaSkill.prototype.requestHandlers = {    LaunchRequest: function (event, context, response) {        this.eventHandlers.onLaunch.call(this, event.request, event.session, response);    },    IntentRequest: function (event, context, response) {        this.eventHandlers.onIntent.call(this, event.request, event.session, response);    },    SessionEndedRequest: function (event, context) {        this.eventHandlers.onSessionEnded(event.request, event.session);        context.succeed();    }};/** * Override any of the eventHandlers as needed */AlexaSkill.prototype.eventHandlers = {    /**     * Called when the session starts.     * Subclasses could have overriden this function to open any necessary resources.     */    onSessionStarted: function (sessionStartedRequest, session) {    },    /**     * Called when the user invokes the skill without specifying what they want.     * The subclass must override this function and provide feedback to the user.     */    onLaunch: function (launchRequest, session, response) {        throw "onLaunch should be overriden by subclass";    },    /**     * Called when the user specifies an intent.     */    onIntent: function (intentRequest, session, response) {        var intent = intentRequest.intent,            intentName = intentRequest.intent.name,            intentHandler = this.intentHandlers[intentName];        if (intentHandler) {            console.log('dispatch intent = ' + intentName);            intentHandler.call(this, intent, session, response);        } else {            throw 'Unsupported intent = ' + intentName;        }    },    /**     * Called when the user ends the session.     * Subclasses could have overriden this function to close any open resources.     */    onSessionEnded: function (sessionEndedRequest, session) {    }};/** * Subclasses should override the intentHandlers with the functions to handle specific intents. */AlexaSkill.prototype.intentHandlers = {};AlexaSkill.prototype.execute = function (event, context) {    try {        console.log("session applicationId: " + event.session.application.applicationId);        // Validate that this request originated from authorized source.        if (this._appId && event.session.application.applicationId !== this._appId) {            console.log("The applicationIds don't match : " + event.session.application.applicationId + " and "                + this._appId);            throw "Invalid applicationId";        }        if (!event.session.attributes) {            event.session.attributes = {};        }        if (event.session.new) {            this.eventHandlers.onSessionStarted(event.request, event.session);        }        // Route the request to the proper handler which may have been overriden.        var requestHandler = this.requestHandlers[event.request.type];        requestHandler.call(this, event, context, new Response(context, event.session));    } catch (e) {        console.log("Unexpected exception " + e);        context.fail(e);    }};var Response = function (context, session) {    this._context = context;    this._session = session;};function createSpeechObject(optionsParam) {    if (optionsParam && optionsParam.type === 'SSML') {        return {            type: optionsParam.type,            ssml: optionsParam.speech        };    } else {        return {            type: optionsParam.type || 'PlainText',            text: optionsParam.speech || optionsParam        }    }}Response.prototype = (function () {    var buildSpeechletResponse = function (options) {        var alexaResponse = {            outputSpeech: createSpeechObject(options.output),            shouldEndSession: options.shouldEndSession        };        if (options.reprompt) {            alexaResponse.reprompt = {                outputSpeech: createSpeechObject(options.reprompt)            };        }        if (options.cardTitle && options.cardContent) {            alexaResponse.card = {                type: "Simple",                title: options.cardTitle,                content: options.cardContent            };        }        var returnResult = {                version: '1.0',                response: alexaResponse        };        if (options.session && options.session.attributes) {            returnResult.sessionAttributes = options.session.attributes;        }        return returnResult;    };    return {        tell: function (speechOutput) {            this._context.succeed(buildSpeechletResponse({                session: this._session,                output: speechOutput,                shouldEndSession: true            }));        },        tellWithCard: function (speechOutput, cardTitle, cardContent) {            this._context.succeed(buildSpeechletResponse({                session: this._session,                output: speechOutput,                cardTitle: cardTitle,                cardContent: cardContent,                shouldEndSession: true            }));        },        ask: function (speechOutput, repromptSpeech) {            this._context.succeed(buildSpeechletResponse({                session: this._session,                output: speechOutput,                reprompt: repromptSpeech,                shouldEndSession: false            }));        },        askWithCard: function (speechOutput, repromptSpeech, cardTitle, cardContent) {            this._context.succeed(buildSpeechletResponse({                session: this._session,                output: speechOutput,                reprompt: repromptSpeech,                cardTitle: cardTitle,                cardContent: cardContent,                shouldEndSession: false            }));        }    };})();module.exports = AlexaSkill;

index.js

JavaScript
/**Jesus is Lord**//**"HOLY SPIRIT FACTS:",    Copyright T.RUTH PUSHPA LATHA. All Rights Reserved.    Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. A copy of the License is located in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.*//** * This example has no external dependencies or session management, and shows the most basic way to create a Lambda function for handling Alexa Skill requests. * * Examples: * One-shot model: *  User: "Alexa, ask HOLY SPIRIT FACTS for a HOLY SPIRIT fact" *  Alexa: "Here's your HOLY SPIRIT Fact: ..." *//** * App ID for the skill */var APP_ID = undefined; //OPTIONAL: replace with "amzn1.echo-sdk-ams.app.[your-unique-value-here]";/** * Array containing HOLY SPIRIT FACTS. */var HOLY_SPIRIT_FACTS = [		
"The Spirit convicts the world of sin, righteousness, and judgment (John 16:8).",	                "The Spirit guides us into all truth (John 16:13).",	                "The Spirit regenerates us (John 3:5-8; Titus 3:5).",	                "The Spirit glorifies and testifies of Christ (John 15:26; 16:14).",	                "The Spirit reveals Christ to us and in us (John 16:14-15).",	                "The Spirit leads us (Rom. 8:14; Gal. 5:18; Matt. 4:1; Luke 4:1).",	                "The Spirit sanctifies us (2 Thess. 2:13; 1 Pet. 1:2; Rom. 5:16).",	                "The Spirit empowers us (Luke 4:14; 24:49; Rom. 15:19; Acts 1:8).",	                "The Spirit fills us (Eph. 5:18; Acts 2:4; 4:8, 31; 9:17).",	                "The Spirit teaches us to pray (Rom. 8:26-27; Jude 1:20).",	                "The Spirit bears witness in us that we are children of God (Rom. 8:16).",	                "The Spirit produces in us the fruit or evidence of His work and presence (Gal. 5:22-23).",	                "The Spirit distributes spiritual gifts and manifestations (the outshining) of His presence to and through the body (1 Cor.12:4, 8-10; Heb. 2:4).",	                "The Spirit anoints us for ministry (Luke 4:18; Acts 10:38).",	                "The Spirit  washes and renews us (Titus 3:5).",	                "The Spirit brings unity and oneness to the body (Eph. 4:3; 2:14-18). Here the Holy Spirit plays the same role that He plays in the Godhead. The Spirit is the life that unites Father and Son. The Spirit plays the same role in the church. When the Holy Spirit is operating in a group of people, He unites them in love. Therefore, a sure evidence of the Holy Spirit working in a group is Love and Unity. Not signs and wonders (those are seasonal and can be counterfeited).",	                "The Spirit is our guarantee and deposit of the future resurrection (2 Cor. 1:22; 2 Cor. 5:5).",	                "The Spirit seals us unto the day of redemption (Eph. 1:13; 4:30).",	                "The Spirit sets us free from the law of sin and death (Rom. 8:2).",	                "The Spirit quickens our mortal bodies (Rom. 8:11).",	                "The Spirit reveals the deep things of God to us (1 Cor. 2:10).",	                "The Spirit reveals what has been given to us from God (1 Cor. 2:12).",	                "The Spirit dwells in us (Rom. 8:9; 1 Cor. 3:16; 2 Tim. 1:14; John 14:17).",	                "The Spirit speaks to, in, and through us (1 Cor. 12:3; 1 Tim. 4:1; Rev. 2:11; Heb 3:7; Matt. 10:20; Acts 2:4; 8:29; 10:19; 11:12, 28; 13:2; 16:6,7; 21:4,11).",	                "The Spirit is the agent by which we are baptized into the body of Christ (1 Cor. 12:13).",	                "The Spirit brings liberty (2 Cor. 3:17).",	                "The Spirit transforms us into the image of Christ (2 Cor. 3:18).",	                "The Spirit cries in our hearts, “Abba, Father” (Gal. 4:6).",	                "The Spirit enables us to wait (Gal. 5:5).",	                "The Spirit supplies us with Christ (Phil. 1:19, KJV).",	                "The Spirit grants everlasting life (Gal. 6:8).",	                "The Spirit gives us access to God the Father (Eph. 2:18).",	                "The Spirit makes us (corporately) God’s habitation (Eph. 2:22).",	                "The Spirit reveals the mystery of God to us (Eph. 3:5).",	                "The Spirit strengthens our spirits (Eph. 3:16).",	                "The Spirit enables us to obey the truth (1 Pet. 1:22).",	                "The Spirit enables us to know that Jesus abides in us (1 John 3:24; 4:13).",	                "The Spirit confesses that Jesus came in the flesh (1 John 4:2).",	                "The Spirit says “Come, Lord Jesus” along with the bride (Rev. 22:17).",	                "The Spirit dispenses God’s love into our hearts (Rom. 5:5).",	                "The Spirit bears witness to the truth in our conscience (Rom. 9:1).",	                "The Spirit teaches us (1 Cor. 2:13; John 14:26).",	                "The Spirit gives us joy (1 Thess. 1:6).",	                "The Spirit enables some to preach the gospel (1 Pet. 1:12).",	                "The Spirit moves us (2 Pet. 1:21).",	                "The Spirit knows the things of God (1 Cor. 2:11).",	                "The Spirit casts out demons (Matt. 12:28).",	                "The Spirit brings things to our remembrance (John 14:26).",	                "The Spirit comforts us (Acts 9:31).",	                "The Spirit makes some overseers in the church and sends some out to the work of church planting [through the body] (Acts 20:28; 13:2).",	                "In short The Holy Spirit unites us to Jesus Christ and to His body. The Spirit reveals Christ to us, gives us His life, and makes Christ alive in us. The Spirit takes the experiences of Jesus . . . His incarnation, ministry, crucifixion, resurrection, and ascension . . . and brings them into our own experience. Because of the Holy Spirit, the history of Jesus Christ becomes our story and experience." ],            "SKILL_NAME" : "British HOLY SPIRIT FACTS",            "GET_FACT_MESSAGE" : "Here's your HOLY SPIRIT fact: ",            "HELP_MESSAGE" : "You can say TrueFriend tell me a HOLY SPIRIT fact, or, you can say exit... What can I help you with?",            "HELP_REPROMPT" : "What can I help you with?",            "STOP_MESSAGE" : "Goodbye!"        }    },    "en-US": {        "translation": {            "FACTS": [	"The Spirit convicts the world of sin, righteousness, and judgment (John 16:8).",	                "The Spirit guides us into all truth (John 16:13).",	                "The Spirit regenerates us (John 3:5-8; Titus 3:5).",	                "The Spirit glorifies and testifies of Christ (John 15:26; 16:14).",	                "The Spirit reveals Christ to us and in us (John 16:14-15).",	                "The Spirit leads us (Rom. 8:14; Gal. 5:18; Matt. 4:1; Luke 4:1).",	                "The Spirit sanctifies us (2 Thess. 2:13; 1 Pet. 1:2; Rom. 5:16).",	                "The Spirit empowers us (Luke 4:14; 24:49; Rom. 15:19; Acts 1:8).",	                "The Spirit fills us (Eph. 5:18; Acts 2:4; 4:8, 31; 9:17).",	                "The Spirit teaches us to pray (Rom. 8:26-27; Jude 1:20).",	                "The Spirit bears witness in us that we are children of God (Rom. 8:16).",	                "The Spirit produces in us the fruit or evidence of His work and presence (Gal. 5:22-23).",	                "The Spirit distributes spiritual gifts and manifestations (the outshining) of His presence to and through the body (1 Cor.12:4, 8-10; Heb. 2:4).",	                "The Spirit anoints us for ministry (Luke 4:18; Acts 10:38).",	                "The Spirit  washes and renews us (Titus 3:5).",	                "The Spirit brings unity and oneness to the body (Eph. 4:3; 2:14-18). Here the Holy Spirit plays the same role that He plays in the Godhead. The Spirit is the life that unites Father and Son. The Spirit plays the same role in the church. When the Holy Spirit is operating in a group of people, He unites them in love. Therefore, a sure evidence of the Holy Spirit working in a group is Love and Unity. Not signs and wonders (those are seasonal and can be counterfeited).",	                "The Spirit is our guarantee and deposit of the future resurrection (2 Cor. 1:22; 2 Cor. 5:5).",	                "The Spirit seals us unto the day of redemption (Eph. 1:13; 4:30).",	                "The Spirit sets us free from the law of sin and death (Rom. 8:2).",	                "The Spirit quickens our mortal bodies (Rom. 8:11).",	                "The Spirit reveals the deep things of God to us (1 Cor. 2:10).",	                "The Spirit reveals what has been given to us from God (1 Cor. 2:12).",	                "The Spirit dwells in us (Rom. 8:9; 1 Cor. 3:16; 2 Tim. 1:14; John 14:17).",	                "The Spirit speaks to, in, and through us (1 Cor. 12:3; 1 Tim. 4:1; Rev. 2:11; Heb 3:7; Matt. 10:20; Acts 2:4; 8:29; 10:19; 11:12, 28; 13:2; 16:6,7; 21:4,11).",	                "The Spirit is the agent by which we are baptized into the body of Christ (1 Cor. 12:13).",	                "The Spirit brings liberty (2 Cor. 3:17).",	                "The Spirit transforms us into the image of Christ (2 Cor. 3:18).",	                "The Spirit cries in our hearts, “Abba, Father” (Gal. 4:6).",	                "The Spirit enables us to wait (Gal. 5:5).",	                "The Spirit supplies us with Christ (Phil. 1:19, KJV).",	                "The Spirit grants everlasting life (Gal. 6:8).",	                "The Spirit gives us access to God the Father (Eph. 2:18).",	                "The Spirit makes us (corporately) God’s habitation (Eph. 2:22).",	                "The Spirit reveals the mystery of God to us (Eph. 3:5).",	                "The Spirit strengthens our spirits (Eph. 3:16).",	                "The Spirit enables us to obey the truth (1 Pet. 1:22).",	                "The Spirit enables us to know that Jesus abides in us (1 John 3:24; 4:13).",	                "The Spirit confesses that Jesus came in the flesh (1 John 4:2).",	                "The Spirit says “Come, Lord Jesus” along with the bride (Rev. 22:17).",	                "The Spirit dispenses God’s love into our hearts (Rom. 5:5).",	                "The Spirit bears witness to the truth in our conscience (Rom. 9:1).",	                "The Spirit teaches us (1 Cor. 2:13; John 14:26).",	                "The Spirit gives us joy (1 Thess. 1:6).",	                "The Spirit enables some to preach the gospel (1 Pet. 1:12).",	                "The Spirit moves us (2 Pet. 1:21).",	                "The Spirit knows the things of God (1 Cor. 2:11).",	                "The Spirit casts out demons (Matt. 12:28).",	                "The Spirit brings things to our remembrance (John 14:26).",	                "The Spirit comforts us (Acts 9:31).",	                "The Spirit makes some overseers in the church and sends some out to the work of church planting [through the body] (Acts 20:28; 13:2).",	                "In short The Holy Spirit unites us to Jesus Christ and to His body. The Spirit reveals Christ to us, gives us His life, and makes Christ alive in us. The Spirit takes the experiences of Jesus . . . His incarnation, ministry, crucifixion, resurrection, and ascension . . . and brings them into our own experience. Because of the Holy Spirit, the history of Jesus Christ becomes our story and experience."];/** * The AlexaSkill prototype and helper functions */var AlexaSkill = require('./AlexaSkill');var Fact = function () {    AlexaSkill.call(this, APP_ID);};// Extend AlexaSkillFact.prototype = Object.create(AlexaSkill.prototype);Fact.prototype.constructor = Fact;Fact.prototype.eventHandlers.onSessionStarted = function (sessionStartedRequest, session) {    //console.log("onSessionStarted requestId: " + sessionStartedRequest.requestId + ", sessionId: " + session.sessionId);    // any initialization logic goes here};Fact.prototype.eventHandlers.onLaunch = function (launchRequest, session, response) {    //console.log("onLaunch requestId: " + launchRequest.requestId + ", sessionId: " + session.sessionId);    handleNewFactRequest(response);};/** * Overridden to show that a subclass can override this function to teardown session state. */Fact.prototype.eventHandlers.onSessionEnded = function (sessionEndedRequest, session) {    //console.log("onSessionEnded requestId: " + sessionEndedRequest.requestId + ", sessionId: " + session.sessionId);    // any cleanup logic goes here};Fact.prototype.intentHandlers = {    "GetNewFactIntent": function (intent, session, response) {        handleNewFactRequest(response);    },    "AMAZON.HelpIntent": function (intent, session, response) {        response.ask("You can say TrueFriend tell me a Holy Spirit fact, or, you can say exit... What can I help you with?", "What can I help you with?");    },    "AMAZON.StopIntent": function (intent, session, response) {        var speechOutput = "Goodbye";        response.tell(speechOutput);    },    "AMAZON.CancelIntent": function (intent, session, response) {        var speechOutput = "Goodbye";        response.tell(speechOutput);    }};/** * Gets a random new fact from the list and returns to the user. */function handleNewFactRequest(response) {    // Get a random Holy Spirit fact from the Holy Spirit FACTS list    var factIndex = Math.floor(Math.random() * HOLY_SPIRIT_FACTS.length);    var randomFact = HOLY_SPIRIT_FACTS[factIndex];    // Create speech output    var speechOutput = "Here's your Holy Spirit fact: " + randomFact;    var cardTitle = "Your Holy Spirit Fact";    response.tellWithCard(speechOutput, TrueFriend, speechOutput);}// Create the handler that responds to the Alexa Request.exports.handler = function (event, context) {    // Create an instance of the TrueFriend skill.    var fact = new Fact();    fact.execute(event, context);};

IntentSchema

JSON
{
  "intents": [
    {
      "intent": "GetNewFactIntent"
    },
    {
      "intent": "AMAZON.HelpIntent"
    },
    {
      "intent": "AMAZON.StopIntent"
    },
    {
      "intent": "AMAZON.CancelIntent"
    }
  ]
 }

Sample Utterances

Tex
GetNewFactIntent a fact
GetNewFactIntent a space fact
GetNewFactIntent tell me a fact
GetNewFactIntent tell me a space fact
GetNewFactIntent give me a fact
GetNewFactIntent give me a space fact
GetNewFactIntent tell me trivia
GetNewFactIntent tell me a space trivia
GetNewFactIntent give me trivia
GetNewFactIntent give me a space trivia
GetNewFactIntent give me some information
GetNewFactIntent give me some space information
GetNewFactIntent tell me something
GetNewFactIntent give me something

Credits

CHRISTIANA JOHN

CHRISTIANA JOHN

0 projects • 0 followers
T RUTH PUSHPA LATHA

T RUTH PUSHPA LATHA

3 projects • 2 followers
Thanks to T RUTH PUSHPA LATHA.

Comments