From 40fb87ce9bf5d205b589899d3b02a0ad6150ad73 Mon Sep 17 00:00:00 2001 From: ChrisChrome Date: Sun, 1 Oct 2023 16:03:29 -0600 Subject: [PATCH] Do some initial testing --- index.js | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 index.js diff --git a/index.js b/index.js new file mode 100644 index 0000000..0fdd732 --- /dev/null +++ b/index.js @@ -0,0 +1,29 @@ +const config = require("./config.json"); +const fs = require("fs"); + +// Setup GQL Client +const { + FreepbxGqlClient, + gql +} = require("freepbx-graphql-client"); +const pbxClient = new FreepbxGqlClient(config.freepbx.url, { + client: { + id: config.freepbx.clientid, + secret: config.freepbx.secret, + } +}); + +// Setup Discord client +const Discord = require("discord.js"); +const client = new Discord.Client({intents: ["Guilds", "GuildMembers"]}); + +// Setup filesystem monitoring (for new voicemail) +const chokidar = require("chokidar"); +const watcher = chokidar.watch(config.freepbx.voicemaildir, { + ignored: /(^|[\/\\])\../, + persistent: true +}); + +watcher.on("all", (event, path) => { + console.log(event, path); +}); \ No newline at end of file