diff --git a/.husky/pre-commit b/.husky/pre-commit deleted file mode 100755 index 20d0d06..0000000 --- a/.husky/pre-commit +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -. "$(dirname "$0")/_/husky.sh" - -npm run lint diff --git a/package.json b/package.json index 94c010e..246b620 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,7 @@ "@types/node": "^20.5.9", "@typescript-eslint/eslint-plugin": "^6.6.0", "@typescript-eslint/parser": "^6.6.0", + "discord-api-types": "^0.38.37", "eslint": "^8.48.0", "eslint-config-prettier": "^9.0.0", "eslint-plugin-jest": "^27.2.3", diff --git a/src/structs/Api.ts b/src/structs/Api.ts index 74aaf73..ddc583a 100644 --- a/src/structs/Api.ts +++ b/src/structs/Api.ts @@ -12,8 +12,9 @@ import { UserInfo, BotsResponse, ShortUser, - BotsQuery, + BotsQuery } from "../typings"; +import { type APIApplicationCommand } from 'discord-api-types/v10'; /** * Top.gg API Client for Posting stats or Fetching data @@ -130,6 +131,14 @@ export class Api extends EventEmitter { return stats; } + public async postCommands(commands: APIApplicationCommand[]) { + if (commands.length <= 0) throw new Error('Your application has no commands'); + + const response = await this._request("POST", "/v1/projects/@me/commands", commands); + + return response; + } + /** * Get your bot's stats *