discord-v13-interaction
Advanced tools
Comparing version 1.0.3 to 1.0.4
20
main.js
@@ -7,15 +7,5 @@ 'use strict'; | ||
this.control = new Promise(async(resolve, reject) => { | ||
await axios.get(`https://api.csycraft.xyz/secretcontrol`, { | ||
headers: { | ||
'Authorization': `${secret}` | ||
}}).then(res => { | ||
resolve(res); | ||
}).catch(err => reject("Api Error!")); | ||
}); | ||
/* Message Send */ | ||
this.send = async function (content) { | ||
let control = await this.control; | ||
if(control.data.code != 5) return console.error(control.data.message); | ||
if (typeof content === 'string') { | ||
@@ -44,4 +34,2 @@ client.api.interactions(interaction.id, interaction.token).callback.post({ | ||
this.random = async function (length) { | ||
let control = await this.control; | ||
if(control.data.code != 5) return console.error(control.data.message); | ||
var result = ''; | ||
@@ -60,4 +48,2 @@ var characters = 'ABCDEFGHIJKLM0123456789NOPQRSTUVWXYZ'; | ||
this.edit = async function (response) { | ||
let control = await this.control; | ||
if(control.data.code != 5) return console.error(control.data.message); | ||
const data = typeof response === 'string' ? { content: response } : response; | ||
@@ -76,4 +62,2 @@ let channel = await client.channels.resolve(interaction.channel_id); | ||
this.numformat = async function (num) { | ||
let control = await this.control; | ||
if(control.data.code != 5) return console.error(control.data.message); | ||
return Math.abs(num) > 999 ? Math.sign(num) * ((Math.abs(num) / 1000).toFixed(1)) + 'k' : Math.sign(num) * Math.abs(num) | ||
@@ -85,4 +69,2 @@ } | ||
this.filter = async function (text) { | ||
let control = await this.control; | ||
if(control.data.code != 5) return console.error(control.data.message); | ||
if (text.length > 100) return "[...]"; | ||
@@ -97,4 +79,2 @@ var swears = ['"', "'", "*", "`", "$", "<", "_", "~", "\n", ">"]; | ||
this.reloadcommand = async function (commands) { | ||
let control = await this.control; | ||
if(control.data.code != 5) return console.error(control.data.message); | ||
const rest = new REST({ version: '9' }).setToken(client.token); | ||
@@ -101,0 +81,0 @@ |
{ | ||
"name": "discord-v13-interaction", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "Discord V13 Interaction Shortcut", | ||
@@ -5,0 +5,0 @@ "main": "main.js", |
5402
80