summaryrefslogtreecommitdiff
path: root/includes/external/addressbook/phone.js
diff options
context:
space:
mode:
authorRaindropsSys <raindrops@equestria.dev>2023-11-17 23:25:29 +0100
committerRaindropsSys <raindrops@equestria.dev>2023-11-17 23:25:29 +0100
commit953ddd82e48dd206cef5ac94456549aed13b3ad5 (patch)
tree8f003106ee2e7f422e5a22d2ee04d0db302e66c0 /includes/external/addressbook/phone.js
parent62a9199846b0c07c03218703b33e8385764f42d9 (diff)
downloadpluralconnect-953ddd82e48dd206cef5ac94456549aed13b3ad5.tar.gz
pluralconnect-953ddd82e48dd206cef5ac94456549aed13b3ad5.tar.bz2
pluralconnect-953ddd82e48dd206cef5ac94456549aed13b3ad5.zip
Updated 30 files and deleted 2976 files (automated)
Diffstat (limited to 'includes/external/addressbook/phone.js')
-rw-r--r--includes/external/addressbook/phone.js59
1 files changed, 0 insertions, 59 deletions
diff --git a/includes/external/addressbook/phone.js b/includes/external/addressbook/phone.js
deleted file mode 100644
index 9f9236b..0000000
--- a/includes/external/addressbook/phone.js
+++ /dev/null
@@ -1,59 +0,0 @@
-const axios = require('axios');
-const apiVersion = "v2";
-const app = require('../../app.json');
-
-function sleep(ms) {
- return new Promise((res) => {
- setTimeout(res, ms);
- });
-}
-
-(async () => {
- let user = process.argv[2];
-
- try {
- let data = (await axios.get(`https://lookups.twilio.com/${apiVersion}/PhoneNumbers/${user}`, {
- auth: {
- username: app.twilio.sid,
- password: app.twilio.secret
- }
- })).data;
-
- if (!data['valid']) throw new Error(JSON.stringify(data['validation_errors']));
-
- let obj = {
- error: null,
- avatar: `https://flagcdn.com/w160/${data['country_code'].toLowerCase()}.png`,
- name: data['national_format'],
- description: data['phone_number'],
- link: `tel:${data['phone_number']}`,
- copy: [
- {
- title: "Copy national phone number",
- text: data['national_format']
- },
- {
- title: "Copy international phone number",
- text: data['phone_number']
- },
- {
- title: "Copy tel: link",
- text: `tel:${data['phone_number']}`
- }
- ]
- }
-
- console.log(JSON.stringify(obj, null, 2));
- } catch (e) {
- console.log(JSON.stringify({
- error: e,
- avatar: "https://img.icons8.com/fluency-systems-regular/64/ffffff/phone.png",
- name: user,
- description: "Phone",
- link: null,
- copy: []
- }, null, 2));
- }
-
-
-})(); \ No newline at end of file