First, you must create an instance of the module by doing this:
const AppManager = require('discord-app-manager')
const token = 'USER TOKEN'
const apps = new AppManager(token)apps.getApps()Returns {Promise<Array<App Object>>}
apps.getApp(appID)| Parameter | Type | Description |
|---|---|---|
| appID | String | The client ID of the application |
Returns {Promise<App Object>}
apps.createApp(details)| Parameter | Type | Description |
|---|---|---|
| details | Object | An object with the application's details |
| details.name | String | The name of the application |
| details.description | String | undefined | The application's description |
| details.icon | String | undefined | A Base64 data URI of the icon |
| details.bot_public | Boolean | undefined | Whether the bot should be public or not |
| details.rpc_origins | Array | undefined | An array of RPC Origins for the application |
| details.redirect_uris | Array | undefined | An array of redirect URIs for the application |
| details.bot_require_code_grant | Boolean | undefined | Whether the bot should require a code grant or not |
Returns {Promise<App Object>}
apps.editApp(appID, details)| Parameter | Type | Description |
|---|---|---|
| appID | String | The client ID of the application you wish to edit |
| details | Object | undefined | An object with the details of the application you wish to edit |
| details.name | String | The name of the application |
| details.description | String | undefined | The application's description |
| details.icon | String | undefined | A Base64 data URI of the icon |
| details.bot_public | Boolean | undefined | Whether the bot should be public or not |
| details.rpc_origins | Array | undefined | An array of RPC Origins for the application |
| details.redirect_uris | Array | undefined | An array of redirect URIs for the application |
| details.bot_require_code_grant | Boolean | undefined | Whether the bot should require a code grant or not |
Returns {Promise<App Object>}
apps.deleteApp(appID)| Parameter | Type | Description |
|---|---|---|
| appID | String | The client ID of the application you wish to delete |
Returns {Promise}
apps.createBotUser(app)| Parameter | Type | Description |
|---|---|---|
| app | String | Object | The client ID of the application you wish to turn into a Bot User, or the details of the Bot User you wish to create |
Returns {Promise<App Object>}
| Field | Type | Description |
|---|---|---|
| redirect_uris | Array | An array of redirect URIs for the application |
| description | String | The description of the application |
| rpc_origins | Array | An array of RPC Origins for the application |
| bot* | Bot Object | The bot object of the application |
| bot_require_code_grant | Boolean | Whether the bot requires a code grant or not |
| name | String | The name of the application |
| secret | String | The secret code for the application |
| bot_public | Boolean | Whether the bot is public or not |
| id | String | The client ID of the application |
| icon | String | null | A hash of the application's icon |
* This is only available if the application is a bot user
| Field | Type | Description |
|---|---|---|
| username | String | The username of the bot user |
| bot | Boolean | This should always be true unless you have a userbot somehow |
| token | String | The auth token for api calls with the bot user |
| avatar | String | null | The hash of the bot user's avatar |
| discriminator | String | The discriminator of the bot user |
| id | String | The ID of the bot user |