Difference between revisions of "Discord/API"
(moved some stuff to other subpages; added Discord.py links) |
|||
(5 intermediate revisions by the same user not shown) | |||
Line 4: | Line 4: | ||
What the API calls a "guild" [https://discordapp.com/developers/docs/resources/guild is the same thing] as a "server". | What the API calls a "guild" [https://discordapp.com/developers/docs/resources/guild is the same thing] as a "server". | ||
+ | |||
+ | Next, you have to authorize the bot to join one or more servers (guilds) by opening a URL based on this one: https://discordapp.com/oauth2/authorize?&client_id=YOUR_CLIENT_ID_HERE&scope=bot&permissions=0 This will let you add the bot to any servers where you have sufficient privileges. | ||
+ | |||
+ | For client-side automation (i.e. running scripts in the Discord client, whether that's the desktop app or a web browser, see [[/client]]. | ||
===Official=== | ===Official=== | ||
* [https://discordapp.com/developers/docs/intro Developer Documentation] | * [https://discordapp.com/developers/docs/intro Developer Documentation] | ||
− | === | + | * [https://discordapp.com/developers/applications/413040429643071498/information Developer Portal] |
− | * [https://github.com/ | + | * [https://github.com/discordapp/discord-oauth2-example Discord OAuth2 Example] |
− | * [https://github.com/ | + | * [https://blog.discordapp.com/the-robot-revolution-has-unofficially-begun-unofficial-api-23a3c722d5bf The Robot Revolution has Unofficially Begun (Unofficial API)]: blog post about the "official unofficial API" |
+ | ===Server API Wrapper=== | ||
+ | * [[DiscordPHP]]: | ||
+ | ** [https://discordphp.readme.io/docs @readme.io] | ||
+ | ** [https://github.com/teamreflex/DiscordPHP GitHub] | ||
+ | * [https://github.com/Cleanse/discord-hypertext discord-hypertext]: "An unofficial PHP API wrapper for the Discord client" | ||
+ | ** [https://github.com/Cleanse/discord-hypertext/tree/master/docs documentation] | ||
+ | * [[Discord.py]]: | ||
+ | ** [https://discordpy.readthedocs.io/en/latest/index.html intro / Documentation Contents] | ||
+ | *** [https://discordpy.readthedocs.io/en/latest/api.html API] | ||
===Archiving=== | ===Archiving=== | ||
− | * [https:// | + | ''see [[/client]]'' |
+ | ===Other Docs=== | ||
+ | * [https://github.com/reactiflux/discord-irc/wiki/Creating-a-discord-bot-&-getting-a-token Creating a discord bot & getting a token] |
Latest revision as of 12:45, 10 March 2020
This page is a seed article. You can help HTYP water it: make a request to expand a given page and/or donate to help give us more writing-hours!
|
API / Bots
Basic setup: the Developer Documentation includes controls for managing bots. Under Applications -> Authorized Apps
you add an application, then add a user for that application. (It will say this is "irrevocable"; I'm not sure what this means, but it may mean that the user will exist forever and you can't delete it, or it may just mean that the user will always be tied to the application for as long as the application still exists. It looks like you can delete the application and start over if you want.) The "bot token" you will need for running the app is on the application properties page, under app bot user -> token
.
What the API calls a "guild" is the same thing as a "server".
Next, you have to authorize the bot to join one or more servers (guilds) by opening a URL based on this one: https://discordapp.com/oauth2/authorize?&client_id=YOUR_CLIENT_ID_HERE&scope=bot&permissions=0 This will let you add the bot to any servers where you have sufficient privileges.
For client-side automation (i.e. running scripts in the Discord client, whether that's the desktop app or a web browser, see /client.
Official
- Developer Documentation
- Developer Portal
- Discord OAuth2 Example
- The Robot Revolution has Unofficially Begun (Unofficial API): blog post about the "official unofficial API"
Server API Wrapper
- DiscordPHP:
- discord-hypertext: "An unofficial PHP API wrapper for the Discord client"
- Discord.py:
Archiving
see /client