This commit is contained in:
Christopher Cookman 2023-08-31 22:40:13 -06:00
parent 1b9ea5afed
commit f274c6b92c
Signed by: ChrisChrome
GPG key ID: A023A26E42C33A42

108
index.js
View file

@ -262,7 +262,7 @@ dcClient.on('ready', async () => {
logMsg = msg; logMsg = msg;
}); });
sendLog = async (message) => { sendLog = async (message) => {
if(curMsg.length + message.length < 2000) { if (curMsg.length + message.length < 2000) {
curMsg = `${curMsg}\n${message}`; curMsg = `${curMsg}\n${message}`;
await logMsg.edit(`\`\`\`ansi\n${curMsg}\`\`\``); await logMsg.edit(`\`\`\`ansi\n${curMsg}\`\`\``);
} else { } else {
@ -285,8 +285,8 @@ dcClient.on('ready', async () => {
sendLog(`${colors.cyan("[INFO]")} Started refreshing application (/) commands.`); sendLog(`${colors.cyan("[INFO]")} Started refreshing application (/) commands.`);
await rest.put( await rest.put(
Routes.applicationGuildCommands(dcClient.user.id, config.discord.guildId), { Routes.applicationGuildCommands(dcClient.user.id, config.discord.guildId), {
body: commands body: commands
} }
); );
sendLog(`${colors.cyan("[INFO]")} Successfully reloaded application (/) commands.`); sendLog(`${colors.cyan("[INFO]")} Successfully reloaded application (/) commands.`);
} catch (error) { } catch (error) {
@ -509,13 +509,13 @@ dcClient.on('interactionCreate', async interaction => {
"color": 0x00ff00, "color": 0x00ff00,
"description": `The SIP server is \`${config.freepbx.server}\``, "description": `The SIP server is \`${config.freepbx.server}\``,
"fields": [{ "fields": [{
"name": "Extension/Username", "name": "Extension/Username",
"value": ext "value": ext
}, },
{ {
"name": "Password", "name": "Password",
"value": `||${result.result.fetchExtension.user.extPassword}||` "value": `||${result.result.fetchExtension.user.extPassword}||`
} }
] ]
}] }]
}) })
@ -547,13 +547,13 @@ dcClient.on('interactionCreate', async interaction => {
"color": 0x00ff00, "color": 0x00ff00,
"description": `The SIP server is \`${config.freepbx.server}\``, "description": `The SIP server is \`${config.freepbx.server}\``,
"fields": [{ "fields": [{
"name": "Extension/Username", "name": "Extension/Username",
"value": result.result.fetchExtension.user.extension "value": result.result.fetchExtension.user.extension
}, },
{ {
"name": "Password", "name": "Password",
"value": `||${result.result.fetchExtension.user.extPassword}||` "value": `||${result.result.fetchExtension.user.extPassword}||`
} }
] ]
}], }],
ephemeral: true ephemeral: true
@ -639,32 +639,32 @@ dcClient.on('interactionCreate', async interaction => {
components: [{ components: [{
type: 1, type: 1,
components: [{ components: [{
type: 2, type: 2,
label: "Get an Extension", label: "Get an Extension",
emoji: { emoji: {
name: "✅" name: "✅"
},
style: 3,
custom_id: "new"
}, },
{ style: 3,
type: 2, custom_id: "new"
label: "Get your extension info", },
emoji: { {
name: "" type: 2,
}, label: "Get your extension info",
style: 1, emoji: {
custom_id: "whoami" name: ""
}, },
{ style: 1,
type: 2, custom_id: "whoami"
label: "Delete your extension", },
emoji: { {
name: "❌" type: 2,
}, label: "Delete your extension",
style: 4, emoji: {
custom_id: "delete" name: "❌"
}, },
style: 4,
custom_id: "delete"
},
] ]
}] }]
}).then(() => { }).then(() => {
@ -746,13 +746,13 @@ dcClient.on('interactionCreate', async interaction => {
"color": 0x00ff00, "color": 0x00ff00,
"description": `The SIP server is \`${config.freepbx.server}\``, "description": `The SIP server is \`${config.freepbx.server}\``,
"fields": [{ "fields": [{
"name": "Extension/Username", "name": "Extension/Username",
"value": ext "value": ext
}, },
{ {
"name": "Password", "name": "Password",
"value": `||${result.result.fetchExtension.user.extPassword}||` "value": `||${result.result.fetchExtension.user.extPassword}||`
} }
] ]
}] }]
}) })
@ -844,13 +844,13 @@ dcClient.on('interactionCreate', async interaction => {
"color": 0x00ff00, "color": 0x00ff00,
"description": `The SIP server is \`${config.freepbx.server}\``, "description": `The SIP server is \`${config.freepbx.server}\``,
"fields": [{ "fields": [{
"name": "Extension/Username", "name": "Extension/Username",
"value": result.result.fetchExtension.user.extension "value": result.result.fetchExtension.user.extension
}, },
{ {
"name": "Password", "name": "Password",
"value": `||${result.result.fetchExtension.user.extPassword}||` "value": `||${result.result.fetchExtension.user.extPassword}||`
} }
] ]
}], }],
ephemeral: true ephemeral: true