Do some initial testing

This commit is contained in:
Christopher Cookman 2023-10-01 16:03:29 -06:00
commit 40fb87ce9b
Signed by: ChrisChrome
GPG key ID: A023A26E42C33A42

29
index.js Normal file
View file

@ -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);
});