-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds approx guild count and get self application endpoint #5971
Conversation
docs/resources/Application.md
Outdated
@@ -19,11 +19,13 @@ | |||
| summary *(deprecated)* | string | **deprecated and will be removed in v11.** An empty string. | | |||
| verify_key | string | the hex encoded key for verification in interactions and the GameSDK's [GetTicket](#DOCS_GAME_SDK_APPLICATIONS/getticket) | | |||
| team | ?[team](#DOCS_TOPICS_TEAMS/data-models-team-object) object | if the application belongs to a team, this will be a list of the members of that team | | |||
| guild_id? | snowflake | if this application is a game sold on Discord, this field will be the guild to which it has been linked | | |||
| guild_id? | snowflake | guild associated with the bot. For example a developer support server. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| guild_id? | snowflake | guild associated with the bot. For example a developer support server. | | |
| guild_id? | snowflake | guild associated with the bot, e.g. a developer support server | |
docs/resources/Application.md
Outdated
| primary_sku_id? | snowflake | if this application is a game sold on Discord, this field will be the id of the "Game SKU" that is created, if exists | | ||
| slug? | string | if this application is a game sold on Discord, this field will be the URL slug that links to the store page | | ||
| cover_image? | string | the application's default rich presence invite [cover image hash](#DOCS_REFERENCE/image-formatting) | | ||
| flags? | integer | the application's public [flags](#DOCS_RESOURCES_APPLICATION/application-object-application-flags) | | ||
| approximate_guild_count? | integer | an approximate count of the bots guild membership. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| approximate_guild_count? | integer | an approximate count of the bots guild membership. | | |
| approximate_guild_count? | integer | an approximate count of the guilds the bot was added to | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"an application" doesn't really match the rest, it should be "the application", like how the current docs say "the bots"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
either way it's not a count of app membership, just bot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe something like an approximate count of the guilds the bot was added to
docs/resources/Application.md
Outdated
@@ -94,3 +96,7 @@ | |||
| ----------- | ---------------- | ---------------------------------------------------------------------------------------------------------- | | |||
| scopes | array of strings | the [scopes](#DOCS_TOPICS_OAUTH2/shared-resources-oauth2-scopes) to add the application to the server with | | |||
| permissions | string | the [permissions](#DOCS_TOPICS_PERMISSIONS) to request for the bot role | | |||
|
|||
## Get Current Bot Application Information % GET /applications/@me |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey there, what is going to happen to the /oauth2/applications/@me
route? Is it still going to be supported, or is it going to be deprecated and eventually replaced with this route?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing changes here. It was just not documented.
Co-authored-by: IllagerCaptain <[email protected]>
What about After doing some more research it seems like this endpoint also returns a partial Also |
I can document those aswell sure, the endpoint actually supports PATCH, these 2 are params.
I included this
👍 |
Ah, yup, sorry. I've completely missed it
huh, setting
|
Oh yeah, i got confused because they still validate it, so it looks settable :husk: |
So is it settable or not 😅 |
If your a user yea, but not for bots |
I'm assuming this is for user security w/ OAuth2 in the case of a token leak? |
Ah yeah, tested it, thanks for the clarification |
So it appears that you can also modify application's And also you can edit |
For me the response doesn't have the Repro: import aiohttp
import asyncio
import os
from dotenv import load_dotenv
load_dotenv()
TOKEN = os.getenv("BOT_TOKEN")
BASE = "https://discord.com/api/v10"
HEADERS = {
'User-Agent': 'DiscordBot (https://github.com/puncher1, 1) Python/3.8 aiohttp/3.8.4',
'Authorization': f'Bot {TOKEN}',
'Content-Type': 'application/json'
}
async def request(method, url, **kwargs):
session = aiohttp.ClientSession()
async with session.request(method, url, **kwargs) as response:
text = await response.text(encoding='utf-8')
print(text)
def get_appinfo():
method = "GET"
url =f"{BASE}/oauth2/applications/@me"
kwargs = {'headers': HEADERS,}
asyncio.run(request(method, url, **kwargs))
get_appinfo() |
Fyi the apps @me endpoint is missing important data like teams and owner. Should not be used as replacement for the oauth route. |
@Puncher1 |
@advaith1 Ah alright. Can you send me a link to the documentation? I can only find |
It is not released yet so it is intentionally not documented yet. The point of this PR is to document it |
@advaith1 Ah okay, thanks for clarity. I thought it's only related to |
docs/resources/Application.md
Outdated
|
||
## Get Current Bot Application Information % GET /applications/@me | ||
|
||
Returns the bot's [application](#DOCS_RESOURCES_APPLICATION/application-object) object. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would add a note that the info returned from this endpoint is partial/different from the oauth2 route
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
standardizing on app since it's Application object 😅
Co-authored-by: shay <[email protected]>
Co-authored-by: shay <[email protected]>
Co-authored-by: shay <[email protected]>
Co-authored-by: shay <[email protected]>
* Add endpoint * Add new fields * Update docs/resources/Application.md Co-authored-by: IllagerCaptain <[email protected]> * Update docs/resources/Application.md Co-authored-by: shay <[email protected]> * Update docs/resources/Application.md Co-authored-by: shay <[email protected]> * Update docs/resources/Application.md Co-authored-by: shay <[email protected]> * Update docs/resources/Application.md Co-authored-by: shay <[email protected]> --------- Co-authored-by: IllagerCaptain <[email protected]> Co-authored-by: shay <[email protected]>
No description provided.