-
-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Implement
GET
current application (#9797)
* feat: implement current application route * refactor: pluralisation Co-authored-by: Suneet Tipirneni <77477100+suneettipirneni@users.noreply.github.com> --------- Co-authored-by: Suneet Tipirneni <77477100+suneettipirneni@users.noreply.github.com> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
- Loading branch information
1 parent
2201157
commit 50106c7
Showing
2 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* eslint-disable jsdoc/check-param-names */ | ||
|
||
import type { RequestData, REST } from '@discordjs/rest'; | ||
import { type RESTGetCurrentApplicationResult, Routes } from 'discord-api-types/v10'; | ||
|
||
export class ApplicationsAPI { | ||
public constructor(private readonly rest: REST) {} | ||
|
||
/** | ||
* Fetches the application associated with the requesting bot user. | ||
* | ||
* @see {@link https://discord.com/developers/docs/resources/application#get-current-application} | ||
* @param options - The options for editing the application | ||
*/ | ||
public async getCurrent({ signal }: Pick<RequestData, 'signal'> = {}) { | ||
return this.rest.get(Routes.currentApplication(), { signal }) as Promise<RESTGetCurrentApplicationResult>; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters