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
{ | |
"description": "A New Flow", | |
"states": [ | |
{ | |
"name": "Trigger", | |
"type": "trigger", | |
"transitions": [ | |
{ | |
"event": "incomingMessage" | |
}, |
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
require('dotenv').config({ debug: process.env.DEBUG }); | |
const { Client, Intents } = require('discord.js'); | |
const client = new Client({ intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES, Intents.FLAGS.DIRECT_MESSAGES], partials: ['MESSAGE', 'CHANNEL'] }); | |
const fetch = require('node-fetch'); | |
const base64 = require('base-64'); | |
const twilioClient = require('twilio')(process.env.TWILIO_ACCOUNT_SID, process.env.TWILIO_AUTH_TOKEN); | |
// --------------------------------------------------------------------------------------------------------------------------- | |
// Discord bot |
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
require('dotenv').config(); | |
const _ = require('lodash'); | |
const Analytics = require('analytics-node'); | |
const analytics = new Analytics(process.env.SEGMENT_KEY); | |
// //////////////////////// | |
// //// User Profile ////// | |
// //////////////////////// | |
let discord_id; | |
let discord_handle; |
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
const express = require('express') | |
const app = express() | |
const port = 4000 | |
require('dotenv').config() | |
const https = require('https') | |
const { last } = require('lodash') | |
const user_id = '902273325076717588' // make this dynamic to the user id from discord | |
let url = `https://profiles.segment.com/v1/spaces/${process.env.SEGMENT_SPACEID}/collections/users/profiles/${user_id}/traits` |
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
const express = require('express') | |
const app = express() | |
const port = 3000 | |
require('dotenv').config() | |
const _ = require('lodash') | |
const Analytics = require('analytics-node'); | |
const analytics = new Analytics(process.env.SEGMENT_KEY); | |
////////////////////////// | |
////// User Profile ////// |
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
{ | |
"description": "Appointment Reminder", | |
"states": [ | |
{ | |
"name": "Trigger", | |
"type": "trigger", | |
"transitions": [ | |
{ | |
"event": "incomingMessage" | |
}, |