@botgate/sdk 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +129 -0
- package/dist/index.d.ts +86 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +136 -0
- package/dist/index.js.map +1 -0
- package/package.json +32 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 BotGate
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# @botgate/sdk
|
|
2
|
+
|
|
3
|
+
SDK oficial do BotGate para integrar as configurações do Dashboard diretamente no seu bot.
|
|
4
|
+
|
|
5
|
+
## Instalação
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @botgate/sdk
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Como funciona
|
|
14
|
+
|
|
15
|
+
Quando um dono de servidor configura seu bot pelo **BotGate Dashboard**, as preferências dele (prefixo, canal de boas-vindas, etc.) ficam salvas no banco de dados do BotGate.
|
|
16
|
+
|
|
17
|
+
Esta lib permite que **o seu bot leia essas configs em tempo real**, com cache local automático para não sobrecarregar a API.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Uso rápido
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
import { BotGateSDK } from "@botgate/sdk";
|
|
25
|
+
|
|
26
|
+
// 1. Inicializar uma vez (no arquivo principal do bot)
|
|
27
|
+
const botgate = new BotGateSDK({
|
|
28
|
+
apiKey: "sua-api-key-do-botgate",
|
|
29
|
+
debug: true, // opcional: mostra logs no console
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
// 2. Usar em qualquer evento
|
|
33
|
+
client.on("messageCreate", async (message) => {
|
|
34
|
+
if (!message.guild) return;
|
|
35
|
+
|
|
36
|
+
// Busca configs do servidor (com cache de 5 minutos automático)
|
|
37
|
+
const settings = await botgate.getGuildSettings(message.guild.id);
|
|
38
|
+
|
|
39
|
+
const prefix = settings.prefix ?? "!";
|
|
40
|
+
if (!message.content.startsWith(prefix)) return;
|
|
41
|
+
|
|
42
|
+
// ... lógica do seu bot
|
|
43
|
+
console.log(`Prefixo usado: ${prefix}`);
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
// 3. Módulo de boas-vindas
|
|
47
|
+
client.on("guildMemberAdd", async (member) => {
|
|
48
|
+
const settings = await botgate.getGuildSettings(member.guild.id);
|
|
49
|
+
|
|
50
|
+
if (!settings.welcome_enabled) return;
|
|
51
|
+
|
|
52
|
+
const channel = member.guild.channels.cache.get(
|
|
53
|
+
settings.welcome_channel_id ?? "",
|
|
54
|
+
);
|
|
55
|
+
if (!channel?.isTextBased()) return;
|
|
56
|
+
|
|
57
|
+
const msg = (settings.welcome_message ?? "Bem-vindo, {user}!").replace(
|
|
58
|
+
"{user}",
|
|
59
|
+
member.toString(),
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
channel.send(msg);
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
// 4. Módulo de logs de auditoria
|
|
66
|
+
client.on("messageDelete", async (message) => {
|
|
67
|
+
if (!message.guild) return;
|
|
68
|
+
const settings = await botgate.getGuildSettings(message.guild.id);
|
|
69
|
+
|
|
70
|
+
if (!settings.logs_enabled) return;
|
|
71
|
+
|
|
72
|
+
const logChannel = message.guild.channels.cache.get(
|
|
73
|
+
settings.logs_channel_id ?? "",
|
|
74
|
+
);
|
|
75
|
+
if (!logChannel?.isTextBased()) return;
|
|
76
|
+
|
|
77
|
+
logChannel.send(
|
|
78
|
+
`🗑️ Mensagem deletada em ${message.channel}: ${message.content}`,
|
|
79
|
+
);
|
|
80
|
+
});
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## Configurações disponíveis
|
|
86
|
+
|
|
87
|
+
| Campo | Tipo | Descrição |
|
|
88
|
+
| -------------------- | --------- | ---------------------------------------------------- |
|
|
89
|
+
| `prefix` | `string` | Prefixo dos comandos do bot |
|
|
90
|
+
| `welcome_enabled` | `boolean` | Liga/desliga o módulo de boas-vindas |
|
|
91
|
+
| `welcome_channel_id` | `string` | ID do canal de boas-vindas |
|
|
92
|
+
| `welcome_message` | `string` | Mensagem personalizada. Use `{user}` para mencionar. |
|
|
93
|
+
| `logs_enabled` | `boolean` | Liga/desliga o módulo de auditoria |
|
|
94
|
+
| `logs_channel_id` | `string` | ID do canal de logs |
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## API
|
|
99
|
+
|
|
100
|
+
### `new BotGateSDK(config)`
|
|
101
|
+
|
|
102
|
+
| Opção | Tipo | Padrão | Descrição |
|
|
103
|
+
| ---------- | --------- | ------- | -------------------------------------------- |
|
|
104
|
+
| `apiKey` | `string` | — | API Key do bot no BotGate (**obrigatório**) |
|
|
105
|
+
| `cacheTtl` | `number` | `300` | Segundos que as configs ficam em cache local |
|
|
106
|
+
| `debug` | `boolean` | `false` | Ativa logs detalhados no console |
|
|
107
|
+
|
|
108
|
+
### `getGuildSettings(guildId, forceRefresh?)`
|
|
109
|
+
|
|
110
|
+
Busca as configs de um servidor. Retorna `{}` vazio se o servidor ainda não foi configurado (nunca vai quebrar o bot).
|
|
111
|
+
|
|
112
|
+
```ts
|
|
113
|
+
const settings = await botgate.getGuildSettings("123456789");
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### `clearCache(guildId?)`
|
|
117
|
+
|
|
118
|
+
Limpa o cache de um servidor específico ou de todos.
|
|
119
|
+
|
|
120
|
+
```ts
|
|
121
|
+
botgate.clearCache("123456789"); // limpa um servidor
|
|
122
|
+
botgate.clearCache(); // limpa tudo
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## Licença
|
|
128
|
+
|
|
129
|
+
MIT
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configurações de inicialização do SDK
|
|
3
|
+
*/
|
|
4
|
+
export interface BotGateSdkConfig {
|
|
5
|
+
/** API Key do bot no BotGate (obrigatório) */
|
|
6
|
+
apiKey: string;
|
|
7
|
+
/** URL base da API do BotGate (opcional, padrão: produção) */
|
|
8
|
+
apiUrl?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Tempo em segundos que as configs de um servidor ficam em cache local.
|
|
11
|
+
* Evita requisições repetidas. (padrão: 300 = 5 minutos)
|
|
12
|
+
*/
|
|
13
|
+
cacheTtl?: number;
|
|
14
|
+
/** Ativar logs de debug no console (padrão: false) */
|
|
15
|
+
debug?: boolean;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Configurações de um servidor salvas pelo usuário no BotGate Dashboard
|
|
19
|
+
*/
|
|
20
|
+
export interface GuildSettings {
|
|
21
|
+
/** Prefixo do bot para esse servidor */
|
|
22
|
+
prefix?: string;
|
|
23
|
+
/** Módulo de boas-vindas ativo? */
|
|
24
|
+
welcome_enabled?: boolean;
|
|
25
|
+
/** ID do canal de boas-vindas */
|
|
26
|
+
welcome_channel_id?: string;
|
|
27
|
+
/** Mensagem personalizada de boas-vindas. Use {user} para mencionar. */
|
|
28
|
+
welcome_message?: string;
|
|
29
|
+
/** Módulo de logs de auditoria ativo? */
|
|
30
|
+
logs_enabled?: boolean;
|
|
31
|
+
/** ID do canal de logs */
|
|
32
|
+
logs_channel_id?: string;
|
|
33
|
+
/** Qualquer outra config futura (extensível) */
|
|
34
|
+
[key: string]: unknown;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Cliente do BotGate SDK para leitura de configurações de servidores.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```ts
|
|
41
|
+
* import { BotGateSDK } from '@botgate/sdk';
|
|
42
|
+
*
|
|
43
|
+
* const botgate = new BotGateSDK({ apiKey: 'sua-api-key' });
|
|
44
|
+
*
|
|
45
|
+
* client.on('messageCreate', async (message) => {
|
|
46
|
+
* const settings = await botgate.getGuildSettings(message.guild.id);
|
|
47
|
+
* const prefix = settings.prefix ?? '!';
|
|
48
|
+
*
|
|
49
|
+
* if (!message.content.startsWith(prefix)) return;
|
|
50
|
+
* // ... lógica do bot
|
|
51
|
+
* });
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
export declare class BotGateSDK {
|
|
55
|
+
private http;
|
|
56
|
+
private cache;
|
|
57
|
+
private defaultTtl;
|
|
58
|
+
private debug;
|
|
59
|
+
constructor(config: BotGateSdkConfig);
|
|
60
|
+
/**
|
|
61
|
+
* Busca as configurações de um servidor específico.
|
|
62
|
+
*
|
|
63
|
+
* As configs são cacheadas localmente por `cacheTtl` segundos
|
|
64
|
+
* para evitar sobrecarga da API em servidores movimentados.
|
|
65
|
+
*
|
|
66
|
+
* @param guildId - ID do servidor Discord
|
|
67
|
+
* @param forceRefresh - Ignorar cache e buscar da API agora (padrão: false)
|
|
68
|
+
*/
|
|
69
|
+
getGuildSettings(guildId: string, forceRefresh?: boolean): Promise<GuildSettings>;
|
|
70
|
+
/**
|
|
71
|
+
* Limpa o cache de um servidor específico.
|
|
72
|
+
* Útil para forçar a releitura após mudanças manuais.
|
|
73
|
+
*
|
|
74
|
+
* @param guildId - ID do servidor. Se omitido, limpa todo o cache.
|
|
75
|
+
*/
|
|
76
|
+
clearCache(guildId?: string): void;
|
|
77
|
+
/**
|
|
78
|
+
* Retorna quantos servidores estão com cache ativo no momento.
|
|
79
|
+
*/
|
|
80
|
+
getCacheSize(): number;
|
|
81
|
+
private getCached;
|
|
82
|
+
private setCache;
|
|
83
|
+
private log;
|
|
84
|
+
}
|
|
85
|
+
export default BotGateSDK;
|
|
86
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,8CAA8C;IAC9C,MAAM,EAAE,MAAM,CAAC;IAEf,8DAA8D;IAC9D,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,sDAAsD;IACtD,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,wCAAwC;IACxC,MAAM,CAAC,EAAE,MAAM,CAAC;IAGhB,mCAAmC;IACnC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,iCAAiC;IACjC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,wEAAwE;IACxE,eAAe,CAAC,EAAE,MAAM,CAAC;IAGzB,yCAAyC;IACzC,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,0BAA0B;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB,gDAAgD;IAChD,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AA+BD;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,UAAU;IACrB,OAAO,CAAC,IAAI,CAAgB;IAC5B,OAAO,CAAC,KAAK,CAAsC;IACnD,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,KAAK,CAAU;gBAEX,MAAM,EAAE,gBAAgB;IAqBpC;;;;;;;;OAQG;IACU,gBAAgB,CAC3B,OAAO,EAAE,MAAM,EACf,YAAY,UAAQ,GACnB,OAAO,CAAC,aAAa,CAAC;IAuCzB;;;;;OAKG;IACI,UAAU,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI;IAUzC;;OAEG;IACI,YAAY,IAAI,MAAM;IAM7B,OAAO,CAAC,SAAS;IAajB,OAAO,CAAC,QAAQ;IAYhB,OAAO,CAAC,GAAG;CAKZ;AAED,eAAe,UAAU,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.BotGateSDK = void 0;
|
|
7
|
+
const axios_1 = __importDefault(require("axios"));
|
|
8
|
+
// ─────────────────────────────────────────────────────────
|
|
9
|
+
// Classe principal
|
|
10
|
+
// ─────────────────────────────────────────────────────────
|
|
11
|
+
/**
|
|
12
|
+
* Cliente do BotGate SDK para leitura de configurações de servidores.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* import { BotGateSDK } from '@botgate/sdk';
|
|
17
|
+
*
|
|
18
|
+
* const botgate = new BotGateSDK({ apiKey: 'sua-api-key' });
|
|
19
|
+
*
|
|
20
|
+
* client.on('messageCreate', async (message) => {
|
|
21
|
+
* const settings = await botgate.getGuildSettings(message.guild.id);
|
|
22
|
+
* const prefix = settings.prefix ?? '!';
|
|
23
|
+
*
|
|
24
|
+
* if (!message.content.startsWith(prefix)) return;
|
|
25
|
+
* // ... lógica do bot
|
|
26
|
+
* });
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
class BotGateSDK {
|
|
30
|
+
constructor(config) {
|
|
31
|
+
var _a, _b, _c;
|
|
32
|
+
this.cache = new Map();
|
|
33
|
+
if (!config.apiKey) {
|
|
34
|
+
throw new Error("[BotGate SDK] apiKey é obrigatório.");
|
|
35
|
+
}
|
|
36
|
+
this.defaultTtl = ((_a = config.cacheTtl) !== null && _a !== void 0 ? _a : 300) * 1000; // converte para ms
|
|
37
|
+
this.debug = (_b = config.debug) !== null && _b !== void 0 ? _b : false;
|
|
38
|
+
this.http = axios_1.default.create({
|
|
39
|
+
baseURL: (_c = config.apiUrl) !== null && _c !== void 0 ? _c : "https://api.botgate.coden8n.shop",
|
|
40
|
+
timeout: 8000,
|
|
41
|
+
headers: {
|
|
42
|
+
Authorization: `Bearer ${config.apiKey}`,
|
|
43
|
+
"Content-Type": "application/json",
|
|
44
|
+
"User-Agent": "BotGate-SDK/1.0.0",
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
this.log("✅ BotGate SDK inicializado.");
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Busca as configurações de um servidor específico.
|
|
51
|
+
*
|
|
52
|
+
* As configs são cacheadas localmente por `cacheTtl` segundos
|
|
53
|
+
* para evitar sobrecarga da API em servidores movimentados.
|
|
54
|
+
*
|
|
55
|
+
* @param guildId - ID do servidor Discord
|
|
56
|
+
* @param forceRefresh - Ignorar cache e buscar da API agora (padrão: false)
|
|
57
|
+
*/
|
|
58
|
+
async getGuildSettings(guildId, forceRefresh = false) {
|
|
59
|
+
// 1. Verificar cache
|
|
60
|
+
if (!forceRefresh) {
|
|
61
|
+
const cached = this.getCached(guildId);
|
|
62
|
+
if (cached) {
|
|
63
|
+
this.log(`📦 Cache hit para guild ${guildId}`);
|
|
64
|
+
return cached;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
// 2. Buscar na API
|
|
68
|
+
this.log(`🌐 Buscando settings para guild ${guildId} na API...`);
|
|
69
|
+
try {
|
|
70
|
+
const response = await this.http.get(`/api/dashboard/sdk/guilds/${guildId}/settings`);
|
|
71
|
+
if (!response.data.success || !response.data.data) {
|
|
72
|
+
this.log(`⚠️ API retornou falha para guild ${guildId}.`);
|
|
73
|
+
return {};
|
|
74
|
+
}
|
|
75
|
+
const { settings, cacheTtl } = response.data.data;
|
|
76
|
+
// 3. Salvar no cache
|
|
77
|
+
this.setCache(guildId, settings, cacheTtl * 1000);
|
|
78
|
+
this.log(`✅ Settings carregados para guild ${guildId}.`);
|
|
79
|
+
return settings;
|
|
80
|
+
}
|
|
81
|
+
catch (error) {
|
|
82
|
+
this.log(`❌ Erro ao buscar settings para guild ${guildId}: ${error.message}`);
|
|
83
|
+
// Retorna objeto vazio para não quebrar o bot por uma falha de rede
|
|
84
|
+
return {};
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Limpa o cache de um servidor específico.
|
|
89
|
+
* Útil para forçar a releitura após mudanças manuais.
|
|
90
|
+
*
|
|
91
|
+
* @param guildId - ID do servidor. Se omitido, limpa todo o cache.
|
|
92
|
+
*/
|
|
93
|
+
clearCache(guildId) {
|
|
94
|
+
if (guildId) {
|
|
95
|
+
this.cache.delete(guildId);
|
|
96
|
+
this.log(`🗑️ Cache limpo para guild ${guildId}`);
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
this.cache.clear();
|
|
100
|
+
this.log("🗑️ Cache global limpo.");
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Retorna quantos servidores estão com cache ativo no momento.
|
|
105
|
+
*/
|
|
106
|
+
getCacheSize() {
|
|
107
|
+
return this.cache.size;
|
|
108
|
+
}
|
|
109
|
+
// ─── Privados ───────────────────────────────────────────
|
|
110
|
+
getCached(guildId) {
|
|
111
|
+
const entry = this.cache.get(guildId);
|
|
112
|
+
if (!entry)
|
|
113
|
+
return null;
|
|
114
|
+
const expired = Date.now() - entry.fetchedAt > entry.ttl;
|
|
115
|
+
if (expired) {
|
|
116
|
+
this.cache.delete(guildId);
|
|
117
|
+
return null;
|
|
118
|
+
}
|
|
119
|
+
return entry.settings;
|
|
120
|
+
}
|
|
121
|
+
setCache(guildId, settings, ttlMs) {
|
|
122
|
+
this.cache.set(guildId, {
|
|
123
|
+
settings,
|
|
124
|
+
fetchedAt: Date.now(),
|
|
125
|
+
ttl: ttlMs || this.defaultTtl,
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
log(message) {
|
|
129
|
+
if (this.debug) {
|
|
130
|
+
console.log(`[BotGate SDK] [${new Date().toISOString()}] ${message}`);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
exports.BotGateSDK = BotGateSDK;
|
|
135
|
+
exports.default = BotGateSDK;
|
|
136
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA6C;AA4E7C,4DAA4D;AAC5D,mBAAmB;AACnB,4DAA4D;AAE5D;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAa,UAAU;IAMrB,YAAY,MAAwB;;QAJ5B,UAAK,GAA4B,IAAI,GAAG,EAAE,CAAC;QAKjD,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;YACnB,MAAM,IAA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G,CAAC;QACzD,IAAI,OAAO,EAAE,CAAC;YACZ,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YAC3B,OAAO,IAAI,CAAC;QACd,CAAC;QAED,OAAO,KAAK,CAAC,QAAQ,CAAC;IACxB,CAAC;IAEO,QAAQ,CACd,OAAe,EACf,QAAuB,EACvB,KAAa;QAEb,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,EAAE;YACtB,QAAQ;YACR,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;YACrB,GAAG,EAAE,KAAK,IAAI,IAAI,CAAC,UAAU;SAC9B,CAAC,CAAC;IACL,CAAC;IAEO,GAAG,CAAC,OAAe;QACzB,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,KAAK,OAAO,EAAE,CAAC,CAAC;QACxE,CAAC;IACH,CAAC;CACF;AArID,gCAqIC;AAED,kBAAe,UAAU,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@botgate/sdk",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "SDK oficial do BotGate para integrar configurações de servidor no seu bot.",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist"
|
|
9
|
+
],
|
|
10
|
+
"scripts": {
|
|
11
|
+
"build": "tsc",
|
|
12
|
+
"dev": "tsc --watch",
|
|
13
|
+
"prepublishOnly": "npm run build"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [
|
|
16
|
+
"discord",
|
|
17
|
+
"bot",
|
|
18
|
+
"botgate",
|
|
19
|
+
"sdk",
|
|
20
|
+
"config",
|
|
21
|
+
"dashboard"
|
|
22
|
+
],
|
|
23
|
+
"author": "BotGate",
|
|
24
|
+
"license": "MIT",
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"axios": "^1.6.0"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@types/node": "^20.0.0",
|
|
30
|
+
"typescript": "^5.0.0"
|
|
31
|
+
}
|
|
32
|
+
}
|