MartinHowarth / lyrebot

A discord bot that speaks what you type in your own voice.
MIT License
24 stars 3 forks source link

Bypass requesting a token by using OAuth 2.0 Implicit Flow #1

Open MysteryPancake opened 5 years ago

MysteryPancake commented 5 years ago

I noticed this bot requests to avatar.lyrebird.ai/api/v0/token on lines 18 to 29.

This step is unnecessary if myvoice.lyrebird.ai/authorize is called with response_type as token. This is described in the documentation as "OAuth 2.0 Implicit Flow".

The functionality is almost identical as the user has to copy the URL either way, so I believe it would be a good way to remove one unnecessary request.

(Note that this method requires OAuth 2.0 Implicit Flow, so it does not work with #4)

MartinHowarth commented 5 years ago

Thanks for the issue! Sounds like a good suggestion, so I'll take a look at implementing this change once I've migrated to the new V1 API of discord.py.