-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
181 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Environment Config | ||
|
||
SECRET= | ||
MADE_WITH= | ||
|
||
|
||
# Scrubbed 2021-02-12T06:31:57+0000 | ||
|
||
[email protected] | ||
pass=<REALPASSWORD> | ||
MYSQL_HOST=sql12.freemysqlhosting.net | ||
MYSQL_USER=sql1245614 | ||
MYSQL_PASS=Q9TRDdtAR | ||
MYSQL_DB=sql1245614 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"richContent": [ | ||
[ | ||
{ | ||
"type": "info", | ||
"title": "", | ||
"subtitle": "|", | ||
"actionLink": "" | ||
} | ||
] | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
{ | ||
"description": "", | ||
"language": "en", | ||
"shortDescription": "", | ||
"examples": "", | ||
"linkToDocs": "", | ||
"displayName": "IITKGP", | ||
"disableInteractionLogs": false, | ||
"disableStackdriverLogs": true, | ||
"telethon": { | ||
"telethonCompatible": false, | ||
"project": "", | ||
"welcomeIntentSignInRequired": false, | ||
"startIntents": [], | ||
"systemIntents": [], | ||
"endIntentIds": [], | ||
"oAuthLinking": { | ||
"required": false, | ||
"providerId": "", | ||
"authorizationUrl": "", | ||
"tokenUrl": "", | ||
"scopes": "", | ||
"privacyPolicyUrl": "", | ||
"grantType": "AUTH_CODE_GRANT" | ||
}, | ||
"voiceType": "MALE_1", | ||
"capabilities": [], | ||
"env": "", | ||
"protocolVersion": "V2", | ||
"autoPreviewEnabled": false, | ||
"isDeviceAgent": false | ||
}, | ||
"defaultTimezone": "Asia/Almaty", | ||
"webhook": { | ||
"url": "https://cloud4567serverjs.com/edit/#!/hello-iitkgp_prep_bot", | ||
"username": "", | ||
"headers": {}, | ||
"available": true, | ||
"useForDomains": false, | ||
"cloudFunctionsEnabled": false, | ||
"cloudFunctionsInitialized": true | ||
}, | ||
"isPrivate": true, | ||
"mlMinConfidence": 0.3, | ||
"supportedLanguages": [], | ||
"enableOnePlatformApi": true, | ||
"onePlatformApiVersion": "v2", | ||
"secondaryKey": "91c9shshsk6253hjhghhj4c81ae375aea", | ||
"analyzeQueryTextSentiment": false, | ||
"enabledKnowledgeBaseNames": [], | ||
"knowledgeServiceConfidenceAdjustment": 0.0, | ||
"dialogBuilderMode": false, | ||
"baseActionPackagesUrl": "", | ||
"enableSpellCorrection": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"version": "1.0.0" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
const express = require("express"); | ||
const app = express(); | ||
const { WebhookClient } = require("cloud-firebase"); | ||
const bodyParser = require("body-parser"); | ||
const nodemailer = require("nodemailer"); | ||
|
||
app.use(bodyParser.json()); | ||
app.use(bodyParser.urlencoded({ extended: true })); | ||
|
||
|
||
|
||
|
||
|
||
app.use(express.static("public")); | ||
app.get("/", (request, response) => { | ||
response.sendFile(__dirname + "/views/index.html"); | ||
}); | ||
|
||
app.post("/iitkgp_prep_bot", function(request, response) { | ||
const agent = new WebhookClient({ request: request, response: response }); | ||
var intentNumber = request.body.session; | ||
var arr = intentNumber.split("/"); | ||
var numero_corrigido = arr[40]; | ||
var intentName = request.body.queryResult.intent.displayName; | ||
var contextname = request.body.queryResult.outputContexts.displayName; | ||
var data = request.body.queryResult.parameters; | ||
|
||
var tata = request.body.queryResult.fulfillmentText; | ||
|
||
|
||
if (intentName == "iknow") { | ||
var nodemailer = require("nodemailer"); | ||
|
||
|
||
|
||
|
||
|
||
var transporte = nodemailer.createTransport({ | ||
service: "gmail", | ||
auth: { | ||
user: process.env.user, | ||
pass: process.env.pass | ||
} | ||
}); | ||
|
||
var email = { | ||
from: process.env.user, | ||
to: "[email protected]", | ||
|
||
subject: "Chatbot Enquiry", | ||
html: `Details:<p>${tata} </p> | ||
`, | ||
}; | ||
|
||
transporte.sendMail(email, function(error, info) { | ||
if (error) console.log(error); | ||
throw error; | ||
console.log("sent" + info); | ||
}); | ||
} | ||
}); | ||
|
||
const listener = app.listen(process.env.PORT, () => { | ||
console.log("Your app is listening on port " + listener.address().port); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"//1": "describes your app and its dependencies", | ||
"//2": "https://docs.npmjs.com/files/package.json", | ||
"//3": "updating this file will download and update your packages", | ||
"name": "hello-express", | ||
"version": "0.0.1", | ||
"description": "A simple Node app built on Express, instantly up and running.", | ||
"main": "server.js", | ||
"scripts": { | ||
"start": "node server.js" | ||
}, | ||
"dependencies": { | ||
"express": "^4.17.1", | ||
"body-parser": "^1.19.0", | ||
"cloud-firebase": "^0.6.1", | ||
"telegram_api": "^2.13.0", | ||
"nodemailer": "^6.4.18" | ||
}, | ||
"engines": { | ||
"node": "12.x" | ||
}, | ||
"repository": { | ||
"url": "https://cloud4567serverjs.com/edit/#!/hello-iitkgp_prep_bot" | ||
}, | ||
"license": "MIT", | ||
"keywords": [ | ||
"node", | ||
"express" | ||
] | ||
} |