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
import { NextApiRequest, NextApiResponse } from 'next'; | |
import Stripe from 'stripe'; | |
import { Readable } from 'node:stream'; | |
export const config = { | |
api: { | |
bodyParser: 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
module.exports = { | |
config: { | |
// default font size in pixels for all tabs | |
fontSize: 14, | |
// font family with optional fallbacks | |
fontFamily: 'Menlo, "DejaVu Sans Mono", "Lucida Console", monospace', | |
// terminal cursor background color and opacity (hex, rgb, hsl, hsv, hwb or cmyk) | |
cursorColor: 'rgba(248,28,229,0.8)', |
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
// Helper function to create carousels | |
let createDeck = (session, tmpDeck, arr, numCards) => { | |
arr.slice(0, numCards).forEach((result) => { | |
let tmpCard = [ | |
new builder.HeroCard(session) | |
.title(result.properties.name[0].text) | |
.subtitle(`${result.properties.category[0].text}, ${result.properties.rating[0].text} stars, ${result.properties.review[0].text}`) | |
.images([ | |
builder.CardImage.create(session, result.properties.image[0].src) | |
.tap(builder.CardAction.showImage(session, result.properties.image[0].src)) |
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
// Count Query | |
MongoClient.connectAsync(uri) | |
.then((db) => { | |
return db.collection(collection).countAsync(session.userData.selector); | |
}) | |
.then((count) => { | |
console.log(`Success: Total of ${count} records`); | |
session.userData.count = count; | |
}) | |
.catch((err) => { |
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
let replyMessage = new builder.Message(session).text('To see what\'s available nearby, just send me your location.'); | |
replyMessage.sourceEvent({ | |
facebook: { | |
quick_replies: [{ | |
content_type: 'location' | |
}] | |
} | |
}); | |
session.send(replyMessage); |