forked from HoloTech/hyperfocus-twitch-bot
Customisations for nico.
This commit is contained in:
+21
@@ -1,6 +1,7 @@
|
||||
import asyncio
|
||||
import logging
|
||||
import websockets
|
||||
from aiohttp import web
|
||||
|
||||
from twitchio.web import AiohttpAdapter
|
||||
|
||||
@@ -20,6 +21,26 @@ class ProxyAiohttpAdapter(AiohttpAdapter):
|
||||
def _find_redirect(self, request):
|
||||
return self.redirect_url
|
||||
|
||||
async def oauth_callback(self, request: web.Request) -> web.Response:
|
||||
payload: FetchTokenPayload = await self.fetch_token(request)
|
||||
|
||||
# Change the default success response to no content...
|
||||
print(payload)
|
||||
if 200 <= payload.response.status < 300:
|
||||
return web.Response(
|
||||
status=200,
|
||||
text=(
|
||||
"Successfully added Croccyfocus to your channel! Good luck with your hyperfocused sessions!\n"
|
||||
"<p>For further usage and setup information, see the documentation <a href=\"{docs}\">here</a>.</p>"
|
||||
).format(
|
||||
docs="https://git.thewisewolf.dev/HoloTech/hyperfocus-twitch-bot/wiki/Focus-docs"
|
||||
),
|
||||
content_type="text/html",
|
||||
)
|
||||
|
||||
# Return the default error responses...
|
||||
return payload.response
|
||||
|
||||
|
||||
async def main():
|
||||
db = Database(conf.data['args'])
|
||||
|
||||
Reference in New Issue
Block a user