-
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #90 from DEVTomatoCake/feat/application-docs
Improve application/bot docs
- Loading branch information
Showing
2 changed files
with
68 additions
and
21 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
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,39 @@ | ||
# Bot and application usage | ||
|
||
## Creating an application | ||
|
||
If your client doesn't have a Developer Portal (yet), you can use the below API requests to create an application. | ||
Make sure to replace the instance API URL if it's different. | ||
|
||
1. Create an application: | ||
```http | ||
POST https://api.{{ project.domain }}/api/v9/applications | ||
Authorization: <User token, e.g. from initial Gateway connection to instance> | ||
Content-Type: application/json | ||
|
||
{ | ||
"name": "My Application" | ||
} | ||
``` | ||
2. Note the returned `id`. | ||
3. Create a bot: | ||
```http | ||
POST https://api.{{ project.domain }}/api/v9/applications/<id>/bot | ||
Authorization: <User token> | ||
``` | ||
|
||
This will return a token for you to use. | ||
|
||
## Adding an application to a server | ||
|
||
```http | ||
POST https://api.{{ project.domain }}/api/v9/oauth2/authorize?client_id=<id> | ||
Authorization: <User token of server owner/member with Manage Guild permissions> | ||
Content-Type: application/json | ||
{ | ||
"guild_id": "<server ID>", | ||
"permissions": "<permission BigInt, e.g. 0 for no permissions or 8 for Administrator>", | ||
"authorize": true | ||
} | ||
``` |