mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 03:08:55 -05:00
Update to use the new bot.application_info()
This commit is contained in:
parent
242d5bf63b
commit
61f7763605
13
red.py
13
red.py
@ -130,14 +130,11 @@ def user_allowed(message):
|
|||||||
|
|
||||||
|
|
||||||
async def get_oauth_url():
|
async def get_oauth_url():
|
||||||
endpoint = "https://discordapp.com/api/oauth2/applications/@me"
|
try:
|
||||||
if bot.headers.get('authorization') is None:
|
data = await bot.application_info()
|
||||||
bot.headers['authorization'] = "Bot {}".format(settings.email)
|
except AttributeError:
|
||||||
|
return "Your discord.py is outdated. Couldn't retrieve invite link."
|
||||||
async with bot.session.get(endpoint, headers=bot.headers) as resp:
|
return discord.utils.oauth_url(data.id)
|
||||||
data = await resp.json()
|
|
||||||
|
|
||||||
return discord.utils.oauth_url(data.get('id'))
|
|
||||||
|
|
||||||
|
|
||||||
def check_folders():
|
def check_folders():
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user