Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .husky/pre-commit

This file was deleted.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
11 changes: 10 additions & 1 deletion src/structs/Api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
*
Expand Down