]> git.puffer.fish Git - matthieu/gru.git/commitdiff
remove warning in d.js types
authorMatthieuCoder <matthieu@matthieu-dev.xyz>
Wed, 4 Jan 2023 17:40:15 +0000 (21:40 +0400)
committerMatthieuCoder <matthieu@matthieu-dev.xyz>
Wed, 4 Jan 2023 17:40:15 +0000 (21:40 +0400)
config/default.example.yml
package.json
src/events/transport.ts
src/handler/index.ts
src/index.ts
tsconfig.json

index d4978c2720e29e92545889b1c4860db3884e659e..7cfeff975a5af4118ad7811144bff8036315226b 100644 (file)
@@ -37,7 +37,6 @@ cache:
     - voice_states_cache
 
 ratelimiter:
-  
 
 # Prometheus monitoring configuration
 monitoring:
index 259cc0c09bb189ccd8ad2720d11abf2dd70be584..6b31c002ad13328421932b30056d0dcbc6d7baa0 100644 (file)
@@ -2,27 +2,29 @@
   "name": "@discordnova/nova-quickstart",
   "version": "1.0.0",
   "description": "Simple example of a nova deployment",
-  "main": "index.js",
+  "main": "dist/index.js",
   "repository": "https://github.com/discordnova/nova-quickstart",
   "author": "MatthieuCoder",
   "license": "Apache-2.0",
   "dependencies": {
     "@discordjs/builders": "^1.4.0",
     "@discordjs/rest": "^1.5.0",
-    "@types/node": "^18.11.18",
-    "@types/ping": "^0.4.1",
     "discord-api-types": "^0.37.25",
     "events": "^3.3.0",
     "glob-regex": "^0.3.2",
     "nats": "^2.10.2",
     "ping": "^0.4.2",
-    "source-map-support": "^0.5.21",
+    "source-map-support": "^0.5.21"
+  },
+  "devDependencies": {
+    "@types/node": "^18.11.18",
+    "@types/ping": "^0.4.1",
     "type-fest": "^3.5.0",
     "typescript": "^4.9.4"
   },
   "scripts": {
     "build": "tsc",
-    "start": "tsc || true && node dist",
-    "register": "tsc || true && node dist/register.js"
+    "start": "tsc && node dist/index.js",
+    "register": "tsc && node dist/register.js"
   }
 }
index 8228d2c49e6feb4ff43728be4b64874bb683f620..882ce416fa9f1db248f6c692b0c54a35cb2d1a90 100644 (file)
@@ -4,10 +4,8 @@ import globRegex from "glob-regex";
 import { REST } from "@discordjs/rest";
 import {
   APIInteractionResponse,
-  GatewayDispatchEvents,
   GatewayDispatchPayload,
   GatewayInteractionCreateDispatch,
-  InteractionResponseType,
   Routes,
 } from "discord-api-types/v10";
 import { CamelCase } from "type-fest";
index 16a56ed8f6e87c8a7e967a3f991008a7218f3a39..9852d60f419ba4a8771da85959dbff81a88c5574 100644 (file)
@@ -53,7 +53,10 @@ export const buildHandler = (commands: Iterable<Command>) => {
     internal.set(command.json.name, command);
   }
 
-  return async (event: APIInteraction, reply?: (data: object) => void) => {
+  return async (
+    event: APIInteraction,
+    reply?: (data: APIInteractionResponse) => void
+  ) => {
     console.log("executing: ", event.data);
     if (event.type === InteractionType.ApplicationCommand) {
       console.log("executing: ", event.data);
index 7e5a5db7cf6ce17a976e29538fbbb7ee56143a30..62cfdcb3f8612b831c0fad0675358906b5f99c1c 100644 (file)
@@ -1,11 +1,12 @@
 import { EventClient } from "./events/index";
 import { buildHandler } from "./handler";
 import { commands } from "./commands";
+import { rest } from "./rest";
 
 /**
  * We instanciate our nova broken client.
  */
-const emitter = new EventClient();
+const emitter = new EventClient(rest);
 
 // We register our slash command handler.
 emitter.on("interactionCreate", buildHandler(commands));
index 5781751ce965894eb2ef7ba4aaa98ccc4141485e..e3d5fd803243a8a7240c8ca1107efb3d0bffb9b8 100644 (file)
@@ -3,6 +3,10 @@
         "outDir": "dist",
         "downlevelIteration": true,
         "target": "ES5",
-        "sourceMap": true
-    }
+        "sourceMap": true,
+        "moduleResolution": "node",
+        "skipLibCheck": true
+    },
+    
+    "exclude": ["node_modules"]
 }
\ No newline at end of file