generated from HoloTech/twitch-bot-template
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 78c77afe88 |
+1
-1
@@ -6,7 +6,7 @@
|
|||||||
url = https://git.thewisewolf.dev/HoloTech/profiles-plugin.git
|
url = https://git.thewisewolf.dev/HoloTech/profiles-plugin.git
|
||||||
[submodule "src/modules/hyperfocus"]
|
[submodule "src/modules/hyperfocus"]
|
||||||
path = src/modules/hyperfocus
|
path = src/modules/hyperfocus
|
||||||
url = https://git.thewisewolf.dev/HoloTech/hyperfocus-plugin.git
|
url = https://git.thewisewolf.dev/LordNico/nicofocus-plugin.git
|
||||||
[submodule "src/modules/exec"]
|
[submodule "src/modules/exec"]
|
||||||
path = src/modules/exec
|
path = src/modules/exec
|
||||||
url = https://git.thewisewolf.dev/HoloTech/exec-plugin.git
|
url = https://git.thewisewolf.dev/HoloTech/exec-plugin.git
|
||||||
|
|||||||
+21
@@ -1,6 +1,7 @@
|
|||||||
import asyncio
|
import asyncio
|
||||||
import logging
|
import logging
|
||||||
import websockets
|
import websockets
|
||||||
|
from aiohttp import web
|
||||||
|
|
||||||
from twitchio.web import AiohttpAdapter
|
from twitchio.web import AiohttpAdapter
|
||||||
|
|
||||||
@@ -20,6 +21,26 @@ class ProxyAiohttpAdapter(AiohttpAdapter):
|
|||||||
def _find_redirect(self, request):
|
def _find_redirect(self, request):
|
||||||
return self.redirect_url
|
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():
|
async def main():
|
||||||
db = Database(conf.data['args'])
|
db = Database(conf.data['args'])
|
||||||
|
|||||||
+5
-3
@@ -14,6 +14,7 @@ class UserAuth(RowModel):
|
|||||||
_timestamp TIMESTAMPTZ NOT NULL DEFAULT NOW()
|
_timestamp TIMESTAMPTZ NOT NULL DEFAULT NOW()
|
||||||
);
|
);
|
||||||
"""
|
"""
|
||||||
|
_schema_ = 'nico'
|
||||||
_tablename_ = 'user_auth'
|
_tablename_ = 'user_auth'
|
||||||
_cache_ = {}
|
_cache_ = {}
|
||||||
|
|
||||||
@@ -36,6 +37,7 @@ class BotChannel(RowModel):
|
|||||||
_timestamp TIMESTAMPTZ NOT NULL DEFAULT NOW()
|
_timestamp TIMESTAMPTZ NOT NULL DEFAULT NOW()
|
||||||
);
|
);
|
||||||
"""
|
"""
|
||||||
|
_schema_ = 'nico'
|
||||||
_tablename_ = 'bot_channels'
|
_tablename_ = 'bot_channels'
|
||||||
_cache_ = {}
|
_cache_ = {}
|
||||||
|
|
||||||
@@ -73,10 +75,10 @@ class BotData(Registry):
|
|||||||
bot_channels = BotChannel.table
|
bot_channels = BotChannel.table
|
||||||
|
|
||||||
"""
|
"""
|
||||||
CREATE TABLE user_auth_scopes(
|
CREATE TABLE nico_user_auth_scopes(
|
||||||
userid TEXT NOT NULL REFERENCES user_auth(userid) ON DELETE CASCADE,
|
userid TEXT NOT NULL REFERENCES nico.user_auth(userid) ON DELETE CASCADE,
|
||||||
scope TEXT NOT NULL
|
scope TEXT NOT NULL
|
||||||
);
|
);
|
||||||
"""
|
"""
|
||||||
user_auth_scopes = Table('user_auth_scopes')
|
user_auth_scopes = Table('user_auth_scopes', schema='nico')
|
||||||
|
|
||||||
|
|||||||
+1
-1
Submodule src/modules/hyperfocus updated: d2050ab2dc...9c834c1c4e
Reference in New Issue
Block a user