commit 40fb87ce9bf5d205b589899d3b02a0ad6150ad73 Author: ChrisChrome Date: Sun Oct 1 16:03:29 2023 -0600 Do some initial testing 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